#45581 [Opn]: htmlspecialchars double encoding &#x hex items
| From: | funky2step at gmail dot com | Date: | Mon, 21 Jul 2008 14:21:12 +0000 |
| Subject: | #45581 [Opn]: htmlspecialchars double encoding &#x hex items | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-127059@lists.php.net to get a copy of this message | ||
ID: 45581
User updated by: funky2step at gmail dot com
Reported By: funky2step at gmail dot com
Status: Open
Bug Type: Unknown/Other Function
Operating System: Red Hat Enterprise Linux ES
PHP Version: 5.2.6
New Comment:
obviously that should have been $out = htmlspecialchars($str,
ENT_COMPAT, 'UTF-8', FALSE);
:)
Previous Comments:
------------------------------------------------------------------------
[2008-07-21 14:14:01] funky2step at gmail dot com
Description:
------------
Trying to use htmlspecialchars() on a string containing &#xHEX;
characters e.g. £
With double encode set to false, it still converts the & to &
Reproduce code:
---------------
$str = "£ one & two";
$out = htmlspecialchars($content, ENT_COMPAT, 'UTF-8', FALSE);
echo $out;
Expected result:
----------------
£ one & two
Actual result:
--------------
£ one & two
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45581&edit=1