Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mistic100 committed Oct 25, 2013
1 parent d701b0a commit 61c7f9d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions admin/include/plugins.class.php
Expand Up @@ -556,12 +556,19 @@ function get_merged_extensions($version=PHPWG_VERSION)
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], '>=');
}

Expand Down

0 comments on commit 61c7f9d

Please sign in to comment.