php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64011 PHP 5.4 BREAKS get_html_translation_table()
Submitted: 2013-01-17 15:34 UTC Modified: 2013-01-18 09:55 UTC
From: spam2 at rhsoft dot net Assigned: cataphract (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.4.10 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: spam2 at rhsoft dot net
New email:
PHP Version: OS:

 

 [2013-01-17 15:34 UTC] spam2 at rhsoft dot net
Description:
------------
the 5.4 return value can not be seriously

hopefully at least "Returns the translation table used by 
htmlspecialchars() and htmlentities()" is NOT true

however, this breaks dialogs for special chars using
this table and insert the enitity in the HTML code

realize that not every page out there is UTF8 and never will be
_________________________________________________________________________

PHP 5.4:

php -r "print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 'ISO8859-1'));"
Array
(
    ["] => "
    [&] => &
    ['] => '
    [<] => &lt;
    [>] => &gt;
)
_________________________________________________________________________

PHP 5.3:

php -r "print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 'ISO8859-1'));"
Array
(
    [ ] => &nbsp;
    [¡] => &iexcl;
    [¢] => &cent;
    [£] => &pound;
    [¤] => &curren;
    [¥] => &yen;
    [¦] => &brvbar;
    [§] => &sect;
    [¨] => &uml;
    [©] => &copy;
    [ª] => &ordf;
    [«] => &laquo;
    [¬] => &not;
    [­] => &shy;
    [®] => &reg;
    [¯] => &macr;
    [°] => &deg;
    [±] => &plusmn;
    [²] => &sup2;
    [³] => &sup3;
    [´] => &acute;
    [µ] => &micro;
    [¶] => &para;
    [·] => &middot;
    [¸] => &cedil;
    [¹] => &sup1;
    [º] => &ordm;
    [»] => &raquo;
    [¼] => &frac14;
    [½] => &frac12;
    [¾] => &frac34;
    [¿] => &iquest;
    [À] => &Agrave;
    [Á] => &Aacute;
    [Â] => &Acirc;
    [Ã] => &Atilde;
    [Ä] => &Auml;
    [Å] => &Aring;
    [Æ] => &AElig;
    [Ç] => &Ccedil;
    [È] => &Egrave;
    [É] => &Eacute;
    [Ê] => &Ecirc;
    [Ë] => &Euml;
    [Ì] => &Igrave;
    [Í] => &Iacute;
    [Î] => &Icirc;
    [Ï] => &Iuml;
    [Ð] => &ETH;
    [Ñ] => &Ntilde;
    [Ò] => &Ograve;
    [Ó] => &Oacute;
    [Ô] => &Ocirc;
    [Õ] => &Otilde;
    [Ö] => &Ouml;
    [×] => &times;
    [Ø] => &Oslash;
    [Ù] => &Ugrave;
    [Ú] => &Uacute;
    [Û] => &Ucirc;
    [Ü] => &Uuml;
    [Ý] => &Yacute;
    [Þ] => &THORN;
    [ß] => &szlig;
    [à] => &agrave;
    [á] => &aacute;
    [â] => &acirc;
    [ã] => &atilde;
    [ä] => &auml;
    [å] => &aring;
    [æ] => &aelig;
    [ç] => &ccedil;
    [è] => &egrave;
    [é] => &eacute;
    [ê] => &ecirc;
    [ë] => &euml;
    [ì] => &igrave;
    [í] => &iacute;
    [î] => &icirc;
    [ï] => &iuml;
    [ð] => &eth;
    [ñ] => &ntilde;
    [ò] => &ograve;
    [ó] => &oacute;
    [ô] => &ocirc;
    [õ] => &otilde;
    [ö] => &ouml;
    [÷] => &divide;
    [ø] => &oslash;
    [ù] => &ugrave;
    [ú] => &uacute;
    [û] => &ucirc;
    [ü] => &uuml;
    [ý] => &yacute;
    [þ] => &thorn;
    [ÿ] => &yuml;
    [&] => &amp;
    ["] => &quot;
    ['] => &#039;
    [<] => &lt;
    [>] => &gt;
)


Test script:
---------------
php -r "print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 'ISO8859-1'));"

Expected result:
----------------
the full entity table like it worked for many years

Actual result:
--------------
a crippled array

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-18 09:55 UTC] cataphract@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cataphract
 [2013-01-18 11:13 UTC] cataphract@php.net
Automatic comment on behalf of glopes@nebm.ist.utl.pt
Revision: http://git.php.net/?p=php-src.git;a=commit;h=77ee200097b592c54fc2f925abcd6db829862d56
Log: Fix bug #64011 (get_html_translation_table())
 [2013-01-18 11:13 UTC] cataphract@php.net
-Status: Verified +Status: Closed
 [2014-10-07 23:20 UTC] stas@php.net
Automatic comment on behalf of glopes@nebm.ist.utl.pt
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=77ee200097b592c54fc2f925abcd6db829862d56
Log: Fix bug #64011 (get_html_translation_table())
 [2014-10-07 23:31 UTC] stas@php.net
Automatic comment on behalf of glopes@nebm.ist.utl.pt
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=77ee200097b592c54fc2f925abcd6db829862d56
Log: Fix bug #64011 (get_html_translation_table())
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC