FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=20219&edit=1

  ID: 20219
  Updated by: daniel.oconnor@gmail.com
  Reported By: webmaster@wackowiki.org
  Summary: Deprecated: preg_replace(): The /e modifier is
                     deprecated, use preg_replace_cal
  Status: Open
  Type: Bug
  Package: HTML_Safe
  PHP Version: 5.5.8
  Roadmap Versions:
  New Comment:

Hi,
Could I get you to open up a pull request with that patch?


Previous Comments:
------------------------------------------------------------------------

[2014-03-15 14:45:53] wackowiki

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
                  );

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 16, '14 at 4:02a
activeMar 16, '14 at 4:02a
posts1
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase