Hi
I have recently set up MSM and duplicated across all the channels/content to the second site.
On some pages I am getting the below error on the new site but not on the old. As far as I can see the pages are identical.
A PHP Error was encountered
Severity: Warning
Message: preg_replace() [function.preg-replace]: Unknown modifier '/'
Filename: core/Security.php
Line Number: 610
A PHP Error was encountered
Severity: Warning
Message: preg_replace() [function.preg-replace]: Unknown modifier '/'
Filename: core/Security.php
Line Number: 610
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at/system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 405Any ideas what could be causing this issue?
Cheers Darren
Hi readio,
Ok - I need you to dig in to /system/codeigniter/Security.php and let me know what you find on line 610.
It should look exactly like this:
$str = preg_replace("/<(\/?[^><]+?)([^A-Za-z\-])(".implode('|', $attribs).")([\s><])([><]*)/i", '<$1$2$4$5', $str, -1, $count);Also, can you post the template for the affected pages, and sample content from an entry that is causing this problem?
It is odd that it only affects one site and not the other.
Cheers,
Hi littlered,
Sorry for the trouble you are having with this!
Are you trying to use special characters as well?
I checked for the follow up on this issue, but it literally fixed itself for the original poster.
Can you tell me a little about your server environment? PHP/MySQL version, etc.
Cheers,
I’m also seeing these errors on occasion in a 2.4.0 install, but no MSM. The issue seems to be the delimiters conflicting possibly with $str that is being passed to that function. I’m guessing URLs? (http://) where the regex doesn’t have the slashes escaped? Changing the delimiters in the preg_replace() call on line 610 of the core/Security.php file makes the warning go away. As a test I change the line to:
$str = preg_replace("#<(\/?[^><]+?)([^A-Za-z\-])(".implode('|', $attribs).")([\s><])([><]*)#i", '<$1$2$4$5', $str, -1, $count);from
$str = preg_replace("/<(\/?[^><]+?)([^A-Za-z\-])(".implode('|', $attribs).")([\s><])([><]*)/i", '<$1$2$4$5', $str, -1, $count);basically replacing the ‘/’ delimiters with ‘#’ ones. I’ll probably go check the 2.5.0 changlog, but is it possible this is a bug that was fixed?
IMPORTANT: I made this change as just a test. I would personally NEVER modify a core file and don’t recommend that you do either.
Hi Adam,
Looking into ExpressionEngine 2.5.2:
$str = preg_replace("/<(\/?[^><]+?)([^A-Za-z<>\-])(.*?)(".implode('|', $attribs).")(.*?)([\s><])([><]*)/i", '<$1 $3$5$6$7', $str, -1, $count);So the line is still the same. I wonder if this would be related to the way PHP is configured? Simply because on my X 10.7.4 homebrew setup, I do not have this issue. Nor does the vast majority of our Community, or we would hear much more about it.
Cheers,
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.