mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
More fixes for PHP7.2
This commit is contained in:
@@ -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']
|
||||
)
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user