Improve HTML escaping

This commit is contained in:
Frédéric Guillot
2014-02-24 18:29:09 -05:00
parent 64e2e07229
commit 8159cc99a6
6 changed files with 14 additions and 9 deletions

View File

@@ -11,6 +11,10 @@ namespace Translator {
\array_shift($args);
\array_unshift($args, get($identifier, $identifier));
foreach ($args as &$arg) {
$arg = htmlspecialchars($arg, ENT_QUOTES, 'UTF-8', false);
}
return \call_user_func_array(
'sprintf',
$args
@@ -77,7 +81,6 @@ namespace Translator {
foreach ($dir as $fileinfo) {
if (strpos($fileinfo->getFilename(), '.php') !== false) {
$locales = array_merge($locales, include $fileinfo->getPathname());
}
}
@@ -91,7 +94,6 @@ namespace Translator {
static $values = array();
if ($locales !== null) {
$values = $locales;
}