#35670 [NEW]: html_entity_decode not decoding correctly
| From: | mglind at utah dot com | Date: | Wed, 14 Dec 2005 19:28:56 +0000 |
| Subject: | #35670 [NEW]: html_entity_decode not decoding correctly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-90440@lists.php.net to get a copy of this message | ||
From: mglind at utah dot com
Operating system: FreeBSD 4.9
PHP version: 4.4.1
PHP Bug Type: Unknown/Other Function
Bug description: html_entity_decode not decoding correctly
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 bug report at http://bugs.php.net/?id=35670&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35670&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35670&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35670&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35670&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35670&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35670&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35670&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35670&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35670&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35670&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35670&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35670&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35670&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35670&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35670&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35670&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35670&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35670&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35670&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35670&r=mysqlcfg