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  


 [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