|
From: <be...@us...> - 2013-09-23 02:06:39
|
Revision: 12085
http://sourceforge.net/p/xoops/svn/12085
Author: beckmi
Date: 2013-09-23 02:06:34 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
Adding PHP 5.2.x implementation for preg_replace_callback
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php 2013-09-22 22:51:50 UTC (rev 12084)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php 2013-09-23 02:06:34 UTC (rev 12085)
@@ -933,11 +933,21 @@
$source = strtr($source, $ttr);
// convert decimal
//$source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation
- $source = preg_replace_callback('/&#(\d+);/m', function($m) {return chr($m[1]);}, $source); // decimal notation
+ //TODO swich to this once we have PHP 5.3 as minimum
+// $source = preg_replace_callback('/&#(\d+);/m', function($m) {return chr($m[1]);}, $source); // decimal notation
+ $source = preg_replace_callback('/&#(\d+);/m', create_function('$matches', "return chr(\$matches[1]);"),$source); // decimal notation
// 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', function($m) {return chr(hexdec($m[1]));}, $source); // hex notation
+ //TODO swich to this once we have PHP 5.3 as minimum
+// $source = preg_replace_callback('/&#x([a-f0-9]+);/mi', function($m) {return chr(hexdec($m[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;
}
-}
\ No newline at end of file
+}
|