Fix deprecated preg_replace with eval

This commit is contained in:
2025-04-21 18:29:22 -07:00
parent 83bdc9bbd7
commit 2541f5ff58

View File

@@ -44,8 +44,13 @@ function PMA_lang($lang_key)
$message = isset($GLOBALS["strConfig$lang_key"]) ? $GLOBALS["strConfig$lang_key"] : $lang_key; $message = isset($GLOBALS["strConfig$lang_key"]) ? $GLOBALS["strConfig$lang_key"] : $lang_key;
$message = str_replace($search, $replace, $message); $message = str_replace($search, $replace, $message);
// replace [a@"$1"]$2[/a] with <a href="$1">$2</a> // replace [a@"$1"]$2[/a] with <a href="$1">$2</a>
$message = preg_replace('#\[a@("?)([^\]]+)\1\]([^\[]+)\[/a\]#e', $message = preg_replace_callback(
"PMA_lang_link_replace('$2', '$3')", $message); '#\[a@("?)([^\]]+)\1\]([^\[]+)\[/a\]#',
function ($matches) {
return PMA_lang_link_replace($matches[2], $matches[3]);
},
$message
);
if (func_num_args() == 1) { if (func_num_args() == 1) {
return $message; return $message;