From 710c652f3980a4d6be8e03c16766fa2039d7d5f2 Mon Sep 17 00:00:00 2001 From: bradymiller Date: Sat, 30 Jan 2010 01:14:56 +0000 Subject: [PATCH] translation definition illegal character bug fix - from artifact 2942625 --- library/translation.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/translation.inc.php b/library/translation.inc.php index b7077311f..db117a739 100644 --- a/library/translation.inc.php +++ b/library/translation.inc.php @@ -33,6 +33,11 @@ function xl($constant,$mode='r',$prepend='',$append='') { $row = SqlFetchArray($res); $string = $row['definition']; if ($string == '') { $string = "$constant"; } + + // remove dangerous characters + $patterns = array ('/\n/','/\r/','/"/',"/'/"); + $replace = array (' ','','`','`'); + $string = preg_replace($patterns, $replace, $string); } $string = "$prepend" . "$string" . "$append"; -- 2.11.4.GIT