aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/plugins.class.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-10-25 11:43:56 +0000
committermistic100 <mistic@piwigo.org>2013-10-25 11:43:56 +0000
commit61c7f9dd6b68fc4d72f361b0b4e1544f475eacb8 (patch)
tree15ede81e918ca0598558335a9df36f2892087e44 /admin/include/plugins.class.php
parentd701b0a37b27772ae1ab94e42be035eb0fb5da3e (diff)
bug 2989: Deprecated: preg_replace(): The /e modifier is deprecated on
git-svn-id: http://piwigo.org/svn/trunk@25133 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/plugins.class.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/admin/include/plugins.class.php b/admin/include/plugins.class.php
index 45de49a01..27a458d7d 100644
--- a/admin/include/plugins.class.php
+++ b/admin/include/plugins.class.php
@@ -556,12 +556,19 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id=\'' . $plugin_id . '\'';
function plugin_version_compare($a, $b)
{
if (strtolower($a) == 'auto') return false;
-
- $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');
- $replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');
-
- $array = preg_replace($pattern, $replacement, array($a, $b));
-
+
+ $array = preg_replace(
+ array('/\.+/', '/\.\Z|\A\./'),
+ array('.', ''),
+ array($a, $b)
+ );
+
+ $array = preg_replace_callback(
+ '/([a-z])/i',
+ create_function('$m', 'return intval($m[1], 36);'),
+ $array
+ );
+
return version_compare($array[0], $array[1], '>=');
}