Skip to content

Commit

Permalink
MDI-1419: Change create_function by anon function
Browse files Browse the repository at this point in the history
  • Loading branch information
koldo picaza committed Nov 24, 2021
1 parent 3394da0 commit 3d5b0b5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
12 changes: 7 additions & 5 deletions src/Smarty-sifo-plugins/modifier.link_urls.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

function smarty_modifier_link_urls($string)
{
$linkedString = preg_replace_callback("/\b(https?):\/\/([-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]*)\b/i",
create_function(
'$matches',
'return "<a href=\'".($matches[0])."\'>".($matches[0])."</a>";'
),$string);
$linkedString = preg_replace_callback(
"/\b(https?):\/\/([-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]*)\b/i",
static function($matches) {
return "<a href=\'".($matches[0])."\'>".($matches[0])."</a>";
},
$string
);

return $linkedString;
}
Expand Down
7 changes: 3 additions & 4 deletions src/Twig-sifo-plugins/filter.link_urls.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ function twig_filter_link_urls()
) {
return preg_replace_callback(
"/\b(https?):\/\/([-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]*)\b/i",
create_function(
'$matches',
'return "<a href=\'".($matches[0])."\'>".($matches[0])."</a>";'
),
static function ($matches) {
return "<a href=\'".($matches[0])."\'>".($matches[0])."</a>";
},
$string
);
}
Expand Down
4 changes: 3 additions & 1 deletion src/adodb5/drivers/adodb-mssql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,9 @@ function Concat()
$arr = $args;
}

array_walk($arr, create_function('&$v', '$v = "CAST(" . $v . " AS VARCHAR(255))";'));
array_walk($arr, static function(&$v) {
$v = "CAST(" . $v . " AS VARCHAR(255))";
});
$s = implode('+',$arr);
if (sizeof($arr) > 0) return "$s";

Expand Down
4 changes: 3 additions & 1 deletion src/adodb5/drivers/adodb-mssqlnative.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ function Concat()
$arr = $args;
}

array_walk($arr, create_function('&$v', '$v = "CAST(" . $v . " AS VARCHAR(255))";'));
array_walk($arr, static function(&$v) {
$v = "CAST(" . $v . " AS VARCHAR(255))";
});
$s = implode('+',$arr);
if (sizeof($arr) > 0) return "$s";

Expand Down

0 comments on commit 3d5b0b5

Please sign in to comment.