|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35670 html_entity_decode not decoding correctly
Submitted: 2005-12-14 20:28 UTC Modified: 2005-12-22 01:00 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mglind at utah dot com Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 4.4.1 OS: FreeBSD 4.9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mglind at utah dot com
New email:
PHP Version: OS:


 [2005-12-14 20:28 UTC] mglind at utah dot com
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 = '&amp;lt;b&amp;gt;This is bold text.&amp;lt;/b&amp;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 = '&amp;lt;b&amp;gt;This is bold text.&amp;lt;/b&amp;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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-14 20:34 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-12-22 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 12 15:01:30 2024 UTC