From:  pear-qa@lists.php.net ("ale.comp_06@xox.ch")
Date:  08 Feb 2016 18:46:32 Hong Kong Time
Newsgroup:  news.php.net/php.pear.bugs
Subject:  

[PEAR-BUG] Bug #20956 [Com]: preg_replace(): The /e modifier is deprecated

NNTP-Posting-Host:  null

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

 ID:               20956
 Comment by:       ale.comp_06@xox.ch
 Reported By:      roxanne at moretoit dot net
 Summary:          preg_replace(): The /e modifier is deprecated
 Status:           Open
 Type:             Bug
 Package:          HTML_Template_IT
 Operating System: linux
 Package Version:  1.3.0
 PHP Version:      5.5.29
 Roadmap Versions: 
 New Comment:

well, of course it should have been:

1091,1093c1091,1093
<         return preg_replace(
<             "##ime",
<             "\$this->getFile('\\1')",
---
>         return preg_replace_callback(
>             "##im",
>             create_function('$matches', 'return
$this->getFile($matches[1]);'),

(< & > above arejust the wrong way round...)


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

[2016-02-08 05:44:28] ale

i don't get the error at the same line, but here is a patch that solves
the issues for the preg_replace with callback in the getFile() method:

1091,1093c1091,1093
<         return preg_replace_callback(
<             "##im",
<             create_function('$matches', 'return
$this->getFile($matches[1]);'),
---
>         return preg_replace(
>             "##ime",
>             "\$this->getFile('\\1')",

using a real anonymous function would of course be even betterer, but
i'm not sure what is the php compatibility level of the module is..

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

[2015-10-01 02:16:48] gregorycu

A work-around for this is to disable deprecation warnings.

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

[2015-10-01 01:27:49] roxswan

Description:
------------
I have an app that has been running just fine for a few years and this
week it throws the following error on the home/login page:

/home/howtoit0/PEAR/HTML/Template/IT.php (2189)
preg_replace(): The /e modifier is deprecated, use preg_replace_callback
instead

My hosting provider did just upgrade MySQL from the version tree 5.5 to
version 5.6 as well as the Apache to 2.4 Version and the PHP releases to
5.5 

I have run all PEAR updates but the problem persists.

Test script:
---------------
You can see this error in action at
http://moretoit.net/practicemonitor/


Expected result:
----------------
The page should show a login box on the left side panel and text in the
main panel.

Actual result:
--------------
At the moment, the login box does not display and the error message
listed in the previous description displays instead of the usual text.

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


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20956&edit=1