1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 10:20:45 +02:00

Bugtracker #4149 - handle utf-8 in toAttribute()

This commit is contained in:
e107steved
2007-10-16 19:05:32 +00:00
parent 04ef72faa7
commit f29882c73f

View File

@@ -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 '';
}