diff --git a/include/dblayer/functions_mysqli.inc.php b/include/dblayer/functions_mysqli.inc.php index cd8c3d4be..f104f5130 100644 --- a/include/dblayer/functions_mysqli.inc.php +++ b/include/dblayer/functions_mysqli.inc.php @@ -400,7 +400,7 @@ CREATE TABLE '.$temporary_tablename.' mass_inserts($temporary_tablename, $all_fields, $datas); if ($flags & MASS_UPDATES_SKIP_EMPTY) - $func_set = create_function('$s', 'return "t1.$s = IFNULL(t2.$s, t1.$s)";'); + $func_set = function($s) { return "t1.$s = IFNULL(t2.$s, t1.$s)"; }; else $func_set = function($s) { return "t1.$s = t2.$s"; }; @@ -416,7 +416,7 @@ UPDATE '.$tablename.' AS t1, '.$temporary_tablename.' AS t2 implode( "\n AND ", array_map( - create_function('$s', 'return "t1.$s = t2.$s";'), + function($s) { return "t1.$s = t2.$s"; }, $dbfields['primary'] ) ); diff --git a/include/functions.inc.php b/include/functions.inc.php index 9bcc12040..31676e1e5 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -1399,12 +1399,6 @@ function safe_json_decode($value) */ function prepend_append_array_items($array, $prepend_str, $append_str) { -/* array_walk( - $array, - create_function('&$s', '$s = "'.$prepend_str.'".$s."'.$append_str.'";') - ); - */ - //New PHP 7.2 code array_walk($array, function(&$value, $key) use($prepend_str,$append_str) { $value = "$prepend_str$value$append_str"; } ); return $array; } diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php index 536e1f3fc..975a4c217 100644 --- a/include/functions_search.inc.php +++ b/include/functions_search.inc.php @@ -123,7 +123,7 @@ function get_sql_search_clause($search) array_walk( $word_clauses, - create_function('&$s','$s="(".$s.")";') + function(&$s){ $s = "(".$s.")"; }, ); // make sure the "mode" is either OR or AND diff --git a/include/template.class.php b/include/template.class.php index 633efe5bf..f017b397c 100644 --- a/include/template.class.php +++ b/include/template.class.php @@ -1102,7 +1102,7 @@ var s,after = document.getElementsByTagName(\'script\')[document.getElementsByTa // replaces echo PHP_STRING_LITERAL; with the string literal value $source = preg_replace_callback( '/\\<\\?php echo ((?:\'(?:(?:\\\\.)|[^\'])*\')|(?:"(?:(?:\\\\.)|[^"])*"));\\?\\>\\n/', - create_function('$matches', 'eval(\'$tmp=\'.$matches[1].\';\');return $tmp;'), + function($matches) { eval('$tmp='.$matches[1].';');return $tmp; }, $source); return $source; }