Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.10.1

Bug #20219 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_cal
Submitted: 2014-03-15 18:45 UTC
From: wackowiki Assigned:
Status: Analyzed Package: HTML_Safe
PHP Version: 5.5.8 OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 9 + 36 = ?

 
 [2014-03-15 18:45 UTC] wackowiki (Wacko Wiki)
Description: ------------ http://www.php.net/manual/en/migration55.deprecated.php Replace preg_replace() e modifier with preg_replace_callback diff --git a/lib/safehtml/safehtml.php b/lib/safehtml/safehtml.php --- a/lib/safehtml/safehtml.php +++ b/lib/safehtml/safehtml.php @@ -350,10 +350,10 @@ } } - $tempval = preg_replace('/&#(\d+);?/me', "chr('\\1')", $value); //"' - $tempval = preg_replace( - '/&#x([0-9a-f]+);?/mei', - "chr(hexdec('\\1'))", + $tempval = preg_replace_callback('/&#(\d+);?/m', function ($matches) { return chr($matches[1]); }, $value); //"' + $tempval = preg_replace_callback( + '/&#x([0-9a-f]+);?/mi', + function ($matches) { return chr(hexdec($matches[1])); }, $tempval );

Comments

 [2014-03-16 09:14 UTC] doconnor (Daniel O'Connor)
Hi, Could I get you to open up a pull request with that patch?
 [2014-03-22 13:28 UTC] doconnor (Daniel O'Connor)
 [2014-03-22 13:33 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Analyzed