Convert special chars in translations to html entities.

This closes
FS#10809 - bug in french translation of AUR web interface

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Loui Chang 2008-07-23 10:36:41 -04:00 committed by Callan Barrett
parent b81e3c2f68
commit 2c6bae2e63

View file

@ -25,7 +25,6 @@
include_once("common_po.inc"); include_once("common_po.inc");
function __() { function __() {
global $_t; global $_t;
global $LANG; global $LANG;
@ -49,6 +48,8 @@ function __() {
$translated = "_${tag}_"; $translated = "_${tag}_";
} }
$translated = htmlspecialchars($translated, ENT_QUOTES);
# This condition is to reorganise the arguments in case of # This condition is to reorganise the arguments in case of
# deprecated usage. __("string", array("string","string")) # deprecated usage. __("string", array("string","string"))
if (!empty($args[1]) && is_array($args[1])) { if (!empty($args[1]) && is_array($args[1])) {
@ -64,6 +65,7 @@ function __() {
$translated = preg_replace("/\%[sh]/", $args[$i], $translated, 1); $translated = preg_replace("/\%[sh]/", $args[$i], $translated, 1);
} }
} }
return $translated; return $translated;
} }