1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/9867] Adjust the implementation of error messages localization.

Use array_map instead of preg_replace.

PHPBB3-9867
This commit is contained in:
rxu
2010-10-26 01:38:09 +08:00
parent ecd648c996
commit 67b243cfc5
4 changed files with 12 additions and 12 deletions

View File

@@ -105,7 +105,7 @@ class ucp_prefs
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
$error = array_map(array($user, 'lang'), $error);
}
$dateformat_options = '';
@@ -227,7 +227,7 @@ class ucp_prefs
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
$error = array_map(array($user, 'lang'), $error);
}
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);