More fixes for PHP7.2

This commit is contained in:
Rob Lensen
2018-03-21 23:02:46 +01:00
parent 50d8aafc77
commit 3db22c0d33
4 changed files with 4 additions and 10 deletions
+2 -2
View File
@@ -400,7 +400,7 @@ CREATE TABLE '.$temporary_tablename.'
mass_inserts($temporary_tablename, $all_fields, $datas); mass_inserts($temporary_tablename, $all_fields, $datas);
if ($flags & MASS_UPDATES_SKIP_EMPTY) 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 else
$func_set = function($s) { return "t1.$s = t2.$s"; }; $func_set = function($s) { return "t1.$s = t2.$s"; };
@@ -416,7 +416,7 @@ UPDATE '.$tablename.' AS t1, '.$temporary_tablename.' AS t2
implode( implode(
"\n AND ", "\n AND ",
array_map( array_map(
create_function('$s', 'return "t1.$s = t2.$s";'), function($s) { return "t1.$s = t2.$s"; },
$dbfields['primary'] $dbfields['primary']
) )
); );
-6
View File
@@ -1399,12 +1399,6 @@ function safe_json_decode($value)
*/ */
function prepend_append_array_items($array, $prepend_str, $append_str) 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"; } ); array_walk($array, function(&$value, $key) use($prepend_str,$append_str) { $value = "$prepend_str$value$append_str"; } );
return $array; return $array;
} }
+1 -1
View File
@@ -123,7 +123,7 @@ function get_sql_search_clause($search)
array_walk( array_walk(
$word_clauses, $word_clauses,
create_function('&$s','$s="(".$s.")";') function(&$s){ $s = "(".$s.")"; },
); );
// make sure the "mode" is either OR or AND // make sure the "mode" is either OR or AND
+1 -1
View File
@@ -1102,7 +1102,7 @@ var s,after = document.getElementsByTagName(\'script\')[document.getElementsByTa
// replaces echo PHP_STRING_LITERAL; with the string literal value // replaces echo PHP_STRING_LITERAL; with the string literal value
$source = preg_replace_callback( $source = preg_replace_callback(
'/\\<\\?php echo ((?:\'(?:(?:\\\\.)|[^\'])*\')|(?:"(?:(?:\\\\.)|[^"])*"));\\?\\>\\n/', '/\\<\\?php echo ((?:\'(?:(?:\\\\.)|[^\'])*\')|(?:"(?:(?:\\\\.)|[^"])*"));\\?\\>\\n/',
create_function('$matches', 'eval(\'$tmp=\'.$matches[1].\';\');return $tmp;'), function($matches) { eval('$tmp='.$matches[1].';');return $tmp; },
$source); $source);
return $source; return $source;
} }