From 6b72df97ecd3cf1296d5206210139ab31d3ad9b2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 2 Jul 2004 22:44:19 +0000 Subject: [PATCH] added charset to htmlspecialchars for multibyte chars --- etemplate/inc/class.xmltool.inc.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.xmltool.inc.php b/etemplate/inc/class.xmltool.inc.php index 138143c109..1b7491abeb 100644 --- a/etemplate/inc/class.xmltool.inc.php +++ b/etemplate/inc/class.xmltool.inc.php @@ -1,4 +1,18 @@ * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id$ */ + function var2xml($name, $data) { $doc = new xmltool('root','',''); @@ -480,7 +494,7 @@ reset($this->attributes); while(list($key,$val) = each ($this->attributes)) { - $result .= ' '.$key.'="'.htmlspecialchars($val).'"'; + $result .= ' '.$key.'="'.htmlspecialchars($val,ENT_COMPAT,'utf-8').'"'; } } @@ -509,12 +523,12 @@ } else*/if(strlen($this->data) > 30 && !empty($this->indentstring)) { - $result .= "\n".$indentstring.$this->indentstring.htmlspecialchars($this->data)."\n"; + $result .= "\n".$indentstring.$this->indentstring.htmlspecialchars($this->data,ENT_COMPAT,'utf-8')."\n"; $endtag_indent = $indentstring; } else { - $result .= htmlspecialchars($this->data); + $result .= htmlspecialchars($this->data,ENT_COMPAT,'utf-8'); $endtag_indent = ''; } break;