Page 1 of 1

Deprecated: preg_replace(): The /e modifier is deprecated ..

PostPosted: Sun Nov 10, 2013 9:15 am
by knut
Hi,

my provider upgraded PHP and now my website is covert with warnings:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in pivotx/modules/smarty/Smarty_Compiler.class.php on line 270

I use the latest pivotx release 2.3.7

To quickly switch of the warning I put:
error_reporting(error_reporting() & ~E_DEPRECATED);
into my index.php, but this didn't help consequently. I tested with different browsers and computers and still see the warning, at least once, most times after clearing the browser cache.

The warning also appears for other files like lib.php line 4742...

Any ideas why I could not switch of the warning?

knut

Re: Deprecated: preg_replace(): The /e modifier is deprecate

PostPosted: Fri Nov 15, 2013 5:07 pm
by Harm10
I've alerted one of the experts about this. In the meantime you could experiment with replacing the indicated preg_replace code by preg_replace_callback.
Some explanation can be found on http://forums.phpfreaks.com/topic/280171-php55-preg-replace-the-e-modifier-is-deprecated-use-preg-replace-callback/?p=1440809

Re: Deprecated: preg_replace(): The /e modifier is deprecate

PostPosted: Wed Dec 11, 2013 12:03 pm
by hansfn
This was fixed in revision 4313. I recommend replacing your current Smarty_Compiler.class.php with the HEAD version. (This fix will be part of PivotX 2.3.8.)