From ac98fab83edcc684249c94ba3dff14670dee41c9 Mon Sep 17 00:00:00 2001 From: Stefek Date: Sat, 24 Nov 2018 17:53:33 +0100 Subject: [PATCH] handling of PHP > 7.0.0. compatibility issues (#371) * handling of PHP > 7.0.0. compatibility issues replace create_function() function as it is deprecated in newer PHP versions. --- wbce/framework/frontend.functions.php | 2 +- wbce/modules/droplets/tool.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wbce/framework/frontend.functions.php b/wbce/framework/frontend.functions.php index c7295cc7a..df0ff179f 100644 --- a/wbce/framework/frontend.functions.php +++ b/wbce/framework/frontend.functions.php @@ -121,7 +121,7 @@ function search_highlight($foo = '', $arr_string = array()) require WB_PATH . '/search/search_convert.php'; } $foo = entities_to_umlauts($foo, 'UTF-8'); - array_walk($arr_string, create_function('&$v,$k', '$v = preg_quote($v, \'~\');')); + array_walk($arr_string, function(&$v, $k){ $v = preg_quote($v, '\'~\''); }); $search_string = implode("|", $arr_string); $string = str_replace($string_ul_umlaut, $string_ul_regex, $search_string); // the highlighting diff --git a/wbce/modules/droplets/tool.php b/wbce/modules/droplets/tool.php index a33bdc2f6..53b0ee402 100644 --- a/wbce/modules/droplets/tool.php +++ b/wbce/modules/droplets/tool.php @@ -195,7 +195,7 @@ 'stat' => $stat, 'count' => count($count), 'name' => $file, - 'list' => implode( ", ", array_map( create_function('$cnt', 'return $cnt["filename"];'), $count ) ), + 'list' => implode( ", ", array_map( function($cnt) { return $cnt["filename"]; }, $count )), ); } } @@ -211,4 +211,4 @@ } // print result -wbce_twig_display($twig_data); \ No newline at end of file +wbce_twig_display($twig_data);