diff --git a/ecrire/inc/charsets.php b/ecrire/inc/charsets.php index 99091afbe8bc51599e2f6d52bb669ea7612a38aa..6186035f170ada578a200d3f22876d69ef8681db 100644 --- a/ecrire/inc/charsets.php +++ b/ecrire/inc/charsets.php @@ -142,19 +142,17 @@ function html2unicode($texte, $secure=false) { if (!$trans) { global $CHARSET; load_charset('html'); - - if (!$secure) { - $CHARSET['html']['amp'] = '&'; - $CHARSET['html']['quot'] = '"'; - $CHARSET['html']['lt'] = '<'; - $CHARSET['html']['gt'] = '>'; - } foreach ($CHARSET['html'] as $key => $val) { $trans["&$key;"] = $val; } } - return strtr($texte, $trans); + if ($secure) + return strtr($texte, $trans); + else + return strtr(strtr($texte, $trans), + array('&'=>'&', '"'=>'"', '<'=>'<', '>'=>'>') + ); } //