|
From: <luc...@us...> - 2013-08-24 22:35:05
|
Revision: 11975
http://sourceforge.net/p/xoops/svn/11975
Author: luciorota
Date: 2013-08-24 22:35:00 +0000 (Sat, 24 Aug 2013)
Log Message:
-----------
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in file /modules/wfdownloads/class/request.php
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-08-24 21:29:18 UTC (rev 11974)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php 2013-08-24 22:35:00 UTC (rev 11975)
@@ -932,9 +932,12 @@
}
$source = strtr($source, $ttr);
// convert decimal
- $source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation
+ //$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
// convert hex
- $source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation
+ //$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
+
return $source;
}
}
\ No newline at end of file
|
|
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
+}
|
|
From: <luc...@us...> - 2013-10-30 22:40:08
|
Revision: 12222
http://sourceforge.net/p/xoops/svn/12222
Author: luciorota
Date: 2013-10-30 22:40:04 +0000 (Wed, 30 Oct 2013)
Log Message:
-----------
return empty array if requested array is null
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-10-30 21:28:59 UTC (rev 12221)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php 2013-10-30 22:40:04 UTC (rev 12222)
@@ -657,7 +657,7 @@
$result = (string)$filter->_remove($filter->_decode((string)$source));
break;
case 'ARRAY' :
- $result = (array)$source;
+ $result = (is_array($source)) ? (array)$source : array();
break;
case 'PATH' :
$pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/';
|