mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
Squashed commit of the following:
commit 7190866ccf15033f27095d635546e46dacbb755e Author: plegall <plg@piwigo.org> Date: Thu Jul 12 10:52:33 2018 +0200 Revert "Replace not maintained cssmin with fork from github https://github.com/natxet/CssMin" This reverts commitc8b12a2ed0. commit 1dac11ecb6783d0d5353c3d250388f018c30fc5c Author: plegall <plg@piwigo.org> Date: Thu Jul 12 10:52:24 2018 +0200 Revert "Update Smarty to 3.1.3" This reverts commitdb684f6151. commit 3ac752dc93912ba5701d22dadd9bb3b81e5bb383 Merge:d1c2e718d58256Author: plegall <plg@piwigo.org> Date: Thu Jul 12 10:50:43 2018 +0200 Merge branch 'php72' of https://github.com/Infern1/Piwigo into Infern1-php72 commit8d58256c45Author: Rob Lensen <rob@bsdfreaks.nl> Date: Wed Mar 21 23:40:36 2018 +0100 new feedcreator version for PHP7 commitbb0fcc3a30Author: Rob Lensen <rob@bsdfreaks.nl> Date: Wed Mar 21 23:26:27 2018 +0100 php72 fixes, replaces each() function commit3db22c0d33Author: Rob Lensen <rob@bsdfreaks.nl> Date: Wed Mar 21 23:02:46 2018 +0100 More fixes for PHP7.2 commit50d8aafc77Author: Rob Lensen <rob@bsdfreaks.nl> Date: Mon Mar 19 23:55:21 2018 +0100 Some more replacements of create_function commit8263335c42Author: Rob Lensen <rob@bsdfreaks.nl> Date: Mon Mar 19 22:54:54 2018 +0100 Fixed indents commit8d58b637c6Merge:c8b12a28a57d77Author: Rob Lensen <rob@bsdfreaks.nl> Date: Tue Feb 27 13:51:32 2018 +0100 Merge remote-tracking branch 'upstream/master' into php72 commitc8b12a2ed0Author: Rob Lensen <rob@bsdfreaks.nl> Date: Thu Jan 18 00:32:46 2018 +0100 Replace not maintained cssmin with fork from github https://github.com/natxet/CssMin commitdb684f6151Author: Rob Lensen <rob@bsdfreaks.nl> Date: Thu Jan 18 00:23:24 2018 +0100 Update Smarty to 3.1.3 commit6a3f8f3e76Author: Rob Lensen <rob@bsdfreaks.nl> Date: Wed Jan 17 23:40:27 2018 +0100 Initial work to support PHP 7.2
This commit is contained in:
@@ -377,7 +377,7 @@ SELECT
|
|||||||
{
|
{
|
||||||
$tags_string = preg_replace_callback(
|
$tags_string = preg_replace_callback(
|
||||||
'/(\d+)/',
|
'/(\d+)/',
|
||||||
create_function('$m', 'global $name_of_tag; return isset($name_of_tag[$m[1]]) ? $name_of_tag[$m[1]] : $m[1];'),
|
function($m) use ($name_of_tag) { return isset($name_of_tag[$m[1]]) ? $name_of_tag[$m[1]] : $m[1];} ,
|
||||||
str_replace(
|
str_replace(
|
||||||
',',
|
',',
|
||||||
', ',
|
', ',
|
||||||
|
|||||||
@@ -675,7 +675,7 @@ SELECT id, id_uppercat, uppercats, rank, global_rank
|
|||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
$cat_map_callback = create_function('$m', 'global $cat_map; return $cat_map[$m[1]]["rank"];');
|
$cat_map_callback = function($m) use ($cat_map) { return $cat_map[$m[1]]["rank"]; };
|
||||||
|
|
||||||
foreach( $cat_map as $id=>$cat )
|
foreach( $cat_map as $id=>$cat )
|
||||||
{
|
{
|
||||||
@@ -1051,7 +1051,7 @@ SELECT id, uppercats, site_id
|
|||||||
$categories = query2array($query);
|
$categories = query2array($query);
|
||||||
|
|
||||||
// filling $cat_fulldirs
|
// filling $cat_fulldirs
|
||||||
$cat_dirs_callback = create_function('$m', 'global $cat_dirs; return $cat_dirs[$m[1]];');
|
$cat_dirs_callback = function($m) use ($cat_dirs) { return $cat_dirs[$m[1]]; };
|
||||||
|
|
||||||
$cat_fulldirs = array();
|
$cat_fulldirs = array();
|
||||||
foreach ($categories as $category)
|
foreach ($categories as $category)
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ function check_sendmail_timeout()
|
|||||||
*/
|
*/
|
||||||
function quote_check_key_list($check_key_list = array())
|
function quote_check_key_list($check_key_list = array())
|
||||||
{
|
{
|
||||||
return array_map(create_function('$s', 'return \'\\\'\'.$s.\'\\\'\';'), $check_key_list);
|
return array_map(function($s) { return '\''.$s.'\''; } , $check_key_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -543,4 +543,4 @@ function subscribe_notification_by_mail($is_admin_request, $check_key_list = arr
|
|||||||
return do_subscribe_unsubscribe_notification_by_mail($is_admin_request, true, $check_key_list);
|
return do_subscribe_unsubscribe_notification_by_mail($is_admin_request, true, $check_key_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -181,10 +181,7 @@ if (!empty($_GET['keyword']))
|
|||||||
'('.
|
'('.
|
||||||
implode(' AND ',
|
implode(' AND ',
|
||||||
array_map(
|
array_map(
|
||||||
create_function(
|
function($s) {return "content LIKE \'%$s%\'"; } ,
|
||||||
'$s',
|
|
||||||
'return "content LIKE \'%$s%\'";'
|
|
||||||
),
|
|
||||||
preg_split('/[\s,;]+/', $_GET['keyword'] )
|
preg_split('/[\s,;]+/', $_GET['keyword'] )
|
||||||
)
|
)
|
||||||
).
|
).
|
||||||
@@ -562,4 +559,4 @@ flush_page_messages();
|
|||||||
if (count($comments) > 0) $template->assign_var_from_handle('COMMENT_LIST', 'comment_list');
|
if (count($comments) > 0) $template->assign_var_from_handle('COMMENT_LIST', 'comment_list');
|
||||||
$template->pparse('comments');
|
$template->pparse('comments');
|
||||||
include(PHPWG_ROOT_PATH.'include/page_tail.php');
|
include(PHPWG_ROOT_PATH.'include/page_tail.php');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -400,9 +400,9 @@ 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 = create_function('$s', 'return "t1.$s = t2.$s";');
|
$func_set = function($s) { return "t1.$s = t2.$s"; };
|
||||||
|
|
||||||
// update of table by joining with temporary table
|
// update of table by joining with temporary table
|
||||||
$query = '
|
$query = '
|
||||||
@@ -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']
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ class Emogrifier {
|
|||||||
|
|
||||||
$nodesWithStyleAttributes = $xpath->query('//*[@style]');
|
$nodesWithStyleAttributes = $xpath->query('//*[@style]');
|
||||||
if ($nodesWithStyleAttributes !== FALSE) {
|
if ($nodesWithStyleAttributes !== FALSE) {
|
||||||
$callback = create_function('$m', 'return strtolower($m[0]);');
|
$callback = function($m) { return strtolower($m[0]); };
|
||||||
|
|
||||||
/** @var $nodeWithStyleAttribute \DOMNode */
|
/** @var $nodeWithStyleAttribute \DOMNode */
|
||||||
foreach ($nodesWithStyleAttributes as $node) {
|
foreach ($nodesWithStyleAttributes as $node) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1399,11 +1399,7 @@ 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_walk($array, function(&$value, $key) use($prepend_str,$append_str) { $value = "$prepend_str$value$append_str"; } );
|
||||||
$array,
|
|
||||||
create_function('&$s', '$s = "'.$prepend_str.'".$s."'.$append_str.'";')
|
|
||||||
);
|
|
||||||
|
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2162,7 +2158,7 @@ SELECT COUNT(DISTINCT(com.id))
|
|||||||
*/
|
*/
|
||||||
function safe_version_compare($a, $b, $op=null)
|
function safe_version_compare($a, $b, $op=null)
|
||||||
{
|
{
|
||||||
$replace_chars = create_function('$m', 'return ord(strtolower($m[1]));');
|
$replace_chars = function($m) { return ord(strtolower($m[1])); };
|
||||||
|
|
||||||
// add dot before groups of letters (version_compare does the same thing)
|
// add dot before groups of letters (version_compare does the same thing)
|
||||||
$a = preg_replace('#([0-9]+)([a-z]+)#i', '$1.$2', $a);
|
$a = preg_replace('#([0-9]+)([a-z]+)#i', '$1.$2', $a);
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ class Template
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
reset($filename_array);
|
reset($filename_array);
|
||||||
while(list($handle, $filename) = each($filename_array))
|
foreach ($filename_array as $handle => $filename)
|
||||||
{
|
{
|
||||||
if (is_null($filename))
|
if (is_null($filename))
|
||||||
{
|
{
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ Request format: ".@$this->_requestFormat." Response format: ".@$this->_responseF
|
|||||||
static function ws_getMethodList($params, &$service)
|
static function ws_getMethodList($params, &$service)
|
||||||
{
|
{
|
||||||
$methods = array_filter($service->_methods,
|
$methods = array_filter($service->_methods,
|
||||||
create_function('$m', 'return empty($m["options"]["hidden"]) || !$m["options"]["hidden"];'));
|
function($m) { return empty($m["options"]["hidden"]) || !$m["options"]["hidden"];} );
|
||||||
return array('methods' => new PwgNamedArray( array_keys($methods),'method' ) );
|
return array('methods' => new PwgNamedArray( array_keys($methods),'method' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ function ws_tags_getList($params, &$service)
|
|||||||
$tags = get_available_tags();
|
$tags = get_available_tags();
|
||||||
if ($params['sort_by_counter'])
|
if ($params['sort_by_counter'])
|
||||||
{
|
{
|
||||||
usort($tags, create_function('$a,$b', 'return -$a["counter"]+$b["counter"];') );
|
usort($tags, function($a, $b) { return -$a["counter"]+$b["counter"]; });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -245,4 +245,4 @@ function ws_tags_add($params, &$service)
|
|||||||
return $creation_output;
|
return $creation_output;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
12
install.php
12
install.php
@@ -33,11 +33,11 @@ if( !@get_magic_quotes_gpc() )
|
|||||||
{
|
{
|
||||||
if( is_array($_POST) )
|
if( is_array($_POST) )
|
||||||
{
|
{
|
||||||
while( list($k, $v) = each($_POST) )
|
foreach($_POST as $k => $v)
|
||||||
{
|
{
|
||||||
if( is_array($_POST[$k]) )
|
if( is_array($_POST[$k]) )
|
||||||
{
|
{
|
||||||
while( list($k2, $v2) = each($_POST[$k]) )
|
foreach($_POST[$k] as $k2 => $v2)
|
||||||
{
|
{
|
||||||
$_POST[$k][$k2] = addslashes($v2);
|
$_POST[$k][$k2] = addslashes($v2);
|
||||||
}
|
}
|
||||||
@@ -53,11 +53,11 @@ if( !@get_magic_quotes_gpc() )
|
|||||||
|
|
||||||
if( is_array($_GET) )
|
if( is_array($_GET) )
|
||||||
{
|
{
|
||||||
while( list($k, $v) = each($_GET) )
|
foreach($_GET as $k => $v )
|
||||||
{
|
{
|
||||||
if( is_array($_GET[$k]) )
|
if( is_array($_GET[$k]) )
|
||||||
{
|
{
|
||||||
while( list($k2, $v2) = each($_GET[$k]) )
|
foreach($_GET[$k] as $k2 => $v2)
|
||||||
{
|
{
|
||||||
$_GET[$k][$k2] = addslashes($v2);
|
$_GET[$k][$k2] = addslashes($v2);
|
||||||
}
|
}
|
||||||
@@ -73,11 +73,11 @@ if( !@get_magic_quotes_gpc() )
|
|||||||
|
|
||||||
if( is_array($_COOKIE) )
|
if( is_array($_COOKIE) )
|
||||||
{
|
{
|
||||||
while( list($k, $v) = each($_COOKIE) )
|
foreach($_COOKIE as $k => $v)
|
||||||
{
|
{
|
||||||
if( is_array($_COOKIE[$k]) )
|
if( is_array($_COOKIE[$k]) )
|
||||||
{
|
{
|
||||||
while( list($k2, $v2) = each($_COOKIE[$k]) )
|
foreach($_COOKIE[$k] as $k2 => $v2)
|
||||||
{
|
{
|
||||||
$_COOKIE[$k][$k2] = addslashes($v2);
|
$_COOKIE[$k][$k2] = addslashes($v2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user