[SPIP] ~maj 3.0.11
[ptitvelo/web/www.git] / www / plugins-dist / safehtml / lib / safehtml / classes / safehtml.php
index 837f013..f906c43 100755 (executable)
@@ -165,8 +165,8 @@ class SafeHTML
        }
     }
 
-    $tempval = preg_replace('/&#(\d+);?/me', "chr('\\1')", $value); //"'
-    $tempval = preg_replace('/&#x([0-9a-f]+);?/mei', "chr(hexdec('\\1'))", $tempval);
+    $tempval = preg_replace_callback('/&#(\d+);?/m', create_function('$m', 'return chr($m[1]);'), $value); 
+    $tempval = preg_replace_callback('/&#x([0-9a-f]+);?/mi', create_function('$m', 'return chr(hexdec($m[1]));'), $tempval);
 
     if ((in_array($name, $this->protocolAttributes)) && 
      (strpos($tempval, ':') !== false))