#46478 [NEW]: htmlentities() uses obsolete mapping table for character entity references
| From: | for-bugs at hnw dot jp | Date: | Tue, 04 Nov 2008 12:56:40 +0000 |
| Subject: | #46478 [NEW]: htmlentities() uses obsolete mapping table for character entity references | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-130593@lists.php.net to get a copy of this message | ||
From: for-bugs at hnw dot jp
Operating system: *
PHP version: 5.2.6
PHP Bug Type: Strings related
Bug description: htmlentities() uses obsolete mapping table for character entity references
Description:
------------
ext/standard/html.c has incorrect mapping table which htmlentities()
uses.
html.c is based on
http://www.unicode.org/Public/MAPPINGS/OBSOLETE/UNI2SGML.TXT,
but this
mapping table is obsolete and not compatible with HTML4.0 or XHTML1.0. For
example, U+2235(which is encoded to "\xe2\x88\xb5" with UTF-8) is not in
http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent,
but htmlentities()
returns "∵".
U+226A(≪) and U+226B(≫) are similler case.
Reproduce code:
---------------
<?php var_dump(htmlentities("\xe2\x88\xb5", ENT_QUOTES, "utf-8"));
Expected result:
----------------
string(3) "æ"
Actual result:
--------------
string(8) "∵"
--
Edit bug report at http://bugs.php.net/?id=46478&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46478&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46478&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46478&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46478&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46478&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=46478&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46478&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46478&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46478&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46478&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46478&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46478&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46478&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46478&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46478&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46478&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46478&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46478&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46478&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46478&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46478&r=mysqlcfg