#35670 [Opn->Fbk]: html_entity_decode not decoding correctly
| From: | sniper@php.net | Date: | Wed, 14 Dec 2005 19:34:40 +0000 |
| Subject: | #35670 [Opn->Fbk]: html_entity_decode not decoding correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-90441@lists.php.net to get a copy of this message | ||
ID: 35670
Updated by: sniper@php.net
Reported By: mglind at utah dot com
-Status: Open
+Status: Feedback
Bug Type: Unknown/Other Function
Operating System: FreeBSD 4.9
PHP Version: 4.4.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-12-14 20:28:56] mglind at utah dot com
Description:
------------
In previous versions I was able to decode the double encoded string by
calling the html_entity_decode() just once. Now I have to call it twice
to get the same functionality.
Reproduce code:
---------------
<?
$encodedString = '&lt;b&gt;This is bold
text.&lt;/b&gt;';
echo $encodedString . '<br /><br />';
echo html_entity_decode($encodedString) . '<br /><br />';
?>
// Got expected result by calling decode funtion twice, which wasn't
needed in previous versions of PHP or at least 4.3.2
<?
$encodedString = '&lt;b&gt;This is bold
text.&lt;/b&gt;';
echo $encodedString . '<br /><br />';
echo html_entity_decode($encodedString) . '<br /><br />';
echo html_entity_decode(html_entity_decode($encodedString));
?>
Expected result:
----------------
This is bold text.
Above text displayed in bold.
Actual result:
--------------
<b>This is bold text.</b>
Displaying as html code rather than bold text.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35670&edit=1