]> git.sur5r.net Git - contagged/blobdiff - inc/functions.php
Replace preg_replace('//e') with preg_replace_callback
[contagged] / inc / functions.php
index cb75190c9d3475ecb1825b1d11d1935a46022dc9..db8c6b0c5fd107b7c36da69ce1bc2e76a79918f2 100644 (file)
@@ -357,9 +357,13 @@ function ldap_store_objectclasses($dn,$classes){
  * @author Andreas Gohr <andi@splitbrain.org>
  */
 function ldap_filterescape($string){
-  return preg_replace('/([\x00-\x1F\*\(\)\\\\])/e',
-                            '"\\\\\".join("",unpack("H2","$1"))',
-                            $string);
+  return preg_replace_callback(
+    '/([\x00-\x1F\*\(\)\\\\])/',
+    function ($matches) {
+      return "\\" . implode("", unpack("H2", $matches[1]));
+    },
+    $string
+  );
 }
 
 /**