Skip to content

Commit

Permalink
minor #13 Remove the usage of create_function() (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was merged into the master branch.

Discussion
----------

Remove the usage of create_function()

Commits
-------

4cf7916 Remove the usage of create_function()
  • Loading branch information
javiereguiluz committed Apr 20, 2018
2 parents 99ac9c3 + 4cf7916 commit b4df5fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion geshi.php
Original file line number Diff line number Diff line change
Expand Up @@ -4733,7 +4733,9 @@ function _optimize_regexp_list_tokens_to_string(&$tokens, $recursed = false) {
// TODO: a|bb|c => [ac]|bb
static $callback_2;
if (!isset($callback_2)) {
$callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";');
$callback_2 = function($matches) {
return '[' . str_replace('|', '', $matches[1]) . ']';
};
}
$list = preg_replace_callback('#\(\?\:((?:.\|)+.)\)#', $callback_2, $list);
}
Expand Down

0 comments on commit b4df5fa

Please sign in to comment.