FreePBX / superfecta

Provides simultaneous use of, and complete control over multiple caller id data sources.
http://www.freepbx.org
GNU General Public License v2.0
58 stars 93 forks source link

superfecta_base.php: preg_replace() with /e creates an error if using "Regular Expressions 1" #270

Open heikothole opened 8 years ago

heikothole commented 8 years ago

Hello, I'm using "Regular Expressions 1" in order to get a caller name from an internal website. But under PHP 5.5.9 the preg_replace() in line 1060 in file superfecta_base.php creates an error. With the following fix, it worked for me:

1060,1063c1060
<           //preg_replace("/&#(\d+);/me", "chr('$1')", $goodStr);
<           $goodStr = preg_replace_callback("/&#(\d+);/m", function($matches) {
<               return "chr($matches[1])";
<           }, $goodStr); //HT: Angepasst wegen "/e" deprecated

---
>           preg_replace("/&#(\d+);/me", "chr('$1')", $goodStr);

Maybe you can use this in the next release.

Heiko

jfrancais commented 7 years ago

Have this same problem. Would love a fix so I dont get the modified code warning in my freepbx interface.