From fe2eb54343f75a6079e36e6cea9953bb0b55b735 Mon Sep 17 00:00:00 2001 From: Wytze van der Raay Date: Sun, 29 Apr 2012 18:32:43 +0000 Subject: [PATCH] Fix for https://bugs.cacert.org/view.php?id=1011 HTML tags in translations are not escaped. --- locale/Makefile | 3 +- locale/escape_special_chars.php | 71 +++++++++++++++++++++++++++++++++ pages/account/40.php | 7 +++- pages/wot/14.php | 6 ++- www/advertising.php | 6 +-- 5 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 locale/escape_special_chars.php diff --git a/locale/Makefile b/locale/Makefile index b703fb2..1517066 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -112,8 +112,7 @@ $(LANGS:%=$(MO_FILE_TEMPLATE)): $(MO_FILE_TEMPLATE): $(PO_FILE_TEMPLATE) $(LANGS:%=$(PO_FILE_TEMPLATE)): mkdir -p $(@D) wget --output-document - '$(@:$(PO_FILE_TEMPLATE)=$(PO_URL_TEMPLATE))' | \ - # convert UTF-8 characters to HTML entities \ - php -r 'while (!feof(STDIN)) echo mb_convert_encoding(fgets(STDIN), "HTML-ENTITIES", "UTF-8");' \ + php -f escape_special_chars.php \ > $@ diff --git a/locale/escape_special_chars.php b/locale/escape_special_chars.php new file mode 100644 index 0000000..32de390 --- /dev/null +++ b/locale/escape_special_chars.php @@ -0,0 +1,71 @@ +#!/usr/bin/php -q +

-

bugs.cacert.org and mark it as private.")?>

+

support@cacert.org", + "bugs.cacert.org")?>

diff --git a/pages/wot/14.php b/pages/wot/14.php index 21c5873..a827ee4 100644 --- a/pages/wot/14.php +++ b/pages/wot/14.php @@ -20,7 +20,11 @@

","")?>

-

http://www.buergerkarte.at/bku/. To activate your E-Card, please go to https://www.sozialversicherung.at/signon2-Registrierung/."))?>

+

http://www.buergerkarte.at/bku/", + "https://www.sozialversicherung.at/signon2-Registrierung/" + )?>

diff --git a/www/advertising.php b/www/advertising.php index e987461..43e4f93 100644 --- a/www/advertising.php +++ b/www/advertising.php @@ -47,7 +47,7 @@ if($months < 1 || $months > 12) { $id = 1; - $errmsg .= _("You can only place an advertisement for up to 12 months.
"); + $errmsg .= _("You can only place an advertisement for up to 12 months.")."
"; $process=""; $oldid=0; } @@ -55,7 +55,7 @@ if(strlen($title) <= 5) { $id = 1; - $errmsg .= _("Link title was too short.
"); + $errmsg .= _("Link title was too short.")."
"; $process=""; $oldid=0; } @@ -63,7 +63,7 @@ if(strlen($link) <= 10) { $id = 1; - $errmsg .= _("Link URI was too short.
"); + $errmsg .= _("Link URI was too short.")."
"; $process=""; $oldid=0; }