We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

MSM PHP errors on second site but not original

Development and Programming

stephenfrank's avatar
stephenfrank
12 posts
13 years ago
stephenfrank's avatar stephenfrank

I had the same problem (as of a few weeks ago) and did some investigating. The most difficult part was that my site didn’t have same errors locally as it did live. This was because the errors were caused by the security library breaking on certain images on the live server.

It looks like the problem was fixed from EE 2.5+. EE 2.4- has the issue.

Notably the lines in the Security.php file 606 & 614 have got appropriate regex escaping in EE 2.5+:

$attribs[] = preg_quote($attr[0], '/');

When image meta data that contains forward slashes is run through the security filter preg_replace it needs those forward slashes escaped.

tiff:XResolution="1800000/10000"

Upgrading solved the issue for myself and hopefully will work for you too 😉

       
Dan Decker's avatar
Dan Decker
7,338 posts
13 years ago
Dan Decker's avatar Dan Decker

Hi Stephen,

Thanks for the info and clarification!

Another instance where the problem indicated in the error line actually resides somewhere else.

Cheers,

       
Adam Christianson's avatar
Adam Christianson
115 posts
13 years ago
Adam Christianson's avatar Adam Christianson

Guess I’ll have o try the upgrade since my server is still reporting these errors under 2.4.0. The odd thing is that I get them on the first load of a page, but then they go away on refresh. Not sure if that has something to do with caching.

       
Dan Decker's avatar
Dan Decker
7,338 posts
13 years ago
Dan Decker's avatar Dan Decker

Hey Adam,

The odd thing is that I get them on the first load of a page, but then they go away on refresh. Not sure if that has something to do with caching.

Something is definitely getting “stuck” then. Have you cleared all of ExpressionEngine’s caches? Same experience in different browsers? Do you have any caching enable at the server level, outside of ExpressionEngine?

Cheers,

       
Adam Christianson's avatar
Adam Christianson
115 posts
13 years ago
Adam Christianson's avatar Adam Christianson

Dan, As noted by ‘stephenfrank’ the issue doesn’t surface for everyone because it has to due with the stuff that’s being passed to the method in the Security.php file. If the passed in string has a “/” in it then it’s not properly escaped and throws the notification error. In my case I think it’s image files being passed through by an image resizer add-on. As stephen noted they can have ‘/’ in the meta data. The error is actually a CI ‘core’ file (system/codeigniter/core/Security.php) and not the EE one. As he pointed out this file was updated on line 606 in the EE 2.5+ update. The original one in 2.4+ was:

$attribs[] = preg_quote($attr[0]);

The new line is:

$attribs[] = preg_quote($attr[0], '/');

It’s a subtle change, but that second param on the preg_quote() function ensures that ‘/’ in the passed in string are properly escaped. I actually changed that line (again just for testing) in my dev install of EE 2.4 and the notification errors immediately went away.

       
Dan Decker's avatar
Dan Decker
7,338 posts
13 years ago
Dan Decker's avatar Dan Decker

Hey Adam,

Thanks for laying it out for me! Had all the pieces, just didn’t complete the puzzle 😊

Is there anything else I can assist you with?

Cheers,

       
Adam Christianson's avatar
Adam Christianson
115 posts
13 years ago
Adam Christianson's avatar Adam Christianson

Nope Dan. As always you’ve been awesome. I wanted mainly to post the clarification for anyone else who may wander across this issue. Since it’s fixed in 2.5+ that is the solution.

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.