From f29882c73f746b75c22b3d4db3c6fa1beee5e88d Mon Sep 17 00:00:00 2001 From: e107steved Date: Tue, 16 Oct 2007 19:05:32 +0000 Subject: [PATCH] Bugtracker #4149 - handle utf-8 in toAttribute() --- e107_handlers/e_parse_class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index eb3ccf626..754a9a5cf 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/e_parse_class.php,v $ -| $Revision: 1.16 $ -| $Date: 2007-10-04 19:08:38 $ +| $Revision: 1.17 $ +| $Date: 2007-10-16 19:05:24 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -643,10 +643,11 @@ class e_parse function toAttribute($text) { $text = str_replace("&","&",$text); // URLs posted without HTML access may have an & in them. - $text = htmlspecialchars($text); // Xhtml compliance. - if (!preg_match('/&#|\'|"|\(|\)|<|>/s', $text)) { - $text = $this->replaceConstants($text); - return $text; + $text = htmlspecialchars($text, ENT_QUOTES, CHARSET); // Xhtml compliance. + if (!preg_match('/&#|\'|"|\(|\)|<|>/s', $text)) + { + $text = $this->replaceConstants($text); + return $text; } else { return ''; }