mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 19:29:58 +03:00
Some more replacements of create_function
This commit is contained in:
parent
8263335c42
commit
50d8aafc77
5 changed files with 8 additions and 11 deletions
|
@ -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(
|
||||||
',',
|
',',
|
||||||
', ',
|
', ',
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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'] )
|
||||||
)
|
)
|
||||||
).
|
).
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue