Skip to content

Commit

Permalink
Replace deprecated function 'create_function' with anonymous function…
Browse files Browse the repository at this point in the history
…s for compatibility with PHP 7.2.
  • Loading branch information
carlwo authored and plegall committed Mar 15, 2019
1 parent 9969cee commit 728975d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin.php
Expand Up @@ -63,7 +63,7 @@
);

$tab_codes = array_map(
create_function('$a', 'return $a["code"];'),
function ($a) { return $a["code"]; },
$tabs
);

Expand Down
2 changes: 1 addition & 1 deletion include/functions_community.inc.php
Expand Up @@ -401,7 +401,7 @@ function community_get_user_limits($user_id)
{
function safe_version_compare($a, $b, $cmp=null)
{
$replace_chars = create_function('$m', 'return ord(strtolower($m[1]));');
$replace_chars = function ($m) { return ord(strtolower($m[1])); };
$a = preg_replace('#([0-9]+)([a-z]+)#i', '$1.$2', $a);
$b = preg_replace('#([0-9]+)([a-z]+)#i', '$1.$2', $b);
$a = preg_replace_callback('#\b([a-z]{1})\b#i', $replace_chars, $a);
Expand Down

0 comments on commit 728975d

Please sign in to comment.