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:

https://github.com/pear/HTML_Safe/pull/2


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

[2014-03-16 05:14:07] doconnor

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

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

[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

  • Daniel Oconnor at Mar 22, 2014 at 8:21 am
    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
    +Status: Analyzed
      Type: Bug
      Package: HTML_Safe
      PHP Version: 5.5.8
      Roadmap Versions:
      New Comment:

    -Status: Open
    +Status: Analyzed



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

    [2014-03-22 09:28:03] doconnor

    https://github.com/pear/HTML_Safe/pull/2

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

    [2014-03-16 05:14:07] doconnor

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

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

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

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 22, '14 at 8:16a
activeMar 22, '14 at 8:21a
posts2
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 2 posts

People

Translate

site design / logo © 2022 Grokbase