Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #35670 : html_entity_decode not decoding correctly
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 1st May 20:04
php-bugs
External User
 
Posts: 1
Default #35670 : html_entity_decode not decoding correctly


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 = '&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($encodedStri ng));
?>


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
  Reply With Quote


  sponsored links


2 1st May 20:04
External User
 
Posts: 1
Default #35670 : html_entity_decode not decoding correctly


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 = '&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($encodedStri ng));
?>


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
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666