[aur-dev] [PATCH] Convert special chars in translations to html entities.

Loui louipc.ist at gmail.com
Wed Jul 23 10:44:18 EDT 2008


>From f2dc41a549b3bf085db8770e47e9e19eb8ae6a71 Mon Sep 17 00:00:00 2001
From: Loui Chang <louipc.ist at gmail.com>
Date: Wed, 23 Jul 2008 10:36:41 -0400
Subject: [PATCH] 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 at gmail.com>
---
 web/lib/translator.inc |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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



More information about the aur-dev mailing list