php.net |  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
Votes:1
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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mglind at utah dot com
New email:
PHP Version: OS:

 

 [2005-12-14 20:28 UTC] 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 = '&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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-14 20:34 UTC] sniper@php.net
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


 [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: Sat Dec 21 14:01:32 2024 UTC