|
From: <rgr...@us...> - 2013-09-22 22:51:53
|
Revision: 12084
http://sourceforge.net/p/xoops/svn/12084
Author: rgriffith
Date: 2013-09-22 22:51:50 +0000 (Sun, 22 Sep 2013)
Log Message:
-----------
Fix preg_replace issue
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php 2013-09-22 21:44:50 UTC (rev 12083)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php 2013-09-22 22:51:50 UTC (rev 12084)
@@ -425,9 +425,17 @@
$charset = defined('_CHARSET') ? constant('_CHARSET') : 'utf-8';
$source = html_entity_decode($source, ENT_QUOTES, $charset);
// convert decimal
- $source = preg_replace('/&#(\d+);/me',"chr(\\1)", $source); // decimal notation
+ $source = preg_replace_callback(
+ '/&#(\d+);/m',
+ create_function('$matches', "return chr(\$matches[1]);"),
+ $source
+ );
// convert hex
- $source = preg_replace('/&#x([a-f0-9]+);/mei',"chr(0x\\1)", $source); // hex notation
+ $source = preg_replace_callback(
+ '/&#x([a-f0-9]+);/mi',
+ create_function('$matches', "return chr('0x'.\$matches[1]);"),
+ $source
+ ); // hex notation
return $source;
}
}
|