php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28042 greek letters in html to entity mapping not correct
Submitted: 2004-04-17 21:38 UTC Modified: 2004-04-19 15:04 UTC
From: ben at csgb dot de Assigned:
Status: Closed Package: Strings related
PHP Version: all OS:
Private report: No CVE-ID: None
 [2004-04-17 21:38 UTC] ben at csgb dot de
Description:
------------
the html entity mappings used by htmlentities() have wrong entries in ent_uni_greek[].

They say "P1" and "p1" instead of "Pi" and "pi". The same goes with "Xi", "Phi", "Chi", "Psi" and their lowercase characters.

Reproduce code:
---------------
<?php
echo htmlentities("????? ?????",ENT_COMPAT,"UTF-8");
?>

Expected result:
----------------
&Xi;&Pi;&Phi;&Chi;&Psi; &xi;&pi;&phi;&chi;&psi;

Actual result:
--------------
&X1;&P1;&Ph1;&Ch1;&Ps1; &x1;&p1;&ph1;&ch1;&ps1;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-17 21:52 UTC] ben at csgb dot de
retry to post code:

<?php
echo htmlentities("????? ?????",ENT_COMPAT,"UTF-8");
?>

here is the diff of php-4.3.4/ext/standard/html.c:

139,140c139,140
<       "Iota", "Kappa", "Lambda", "Mu", "Nu", "X1", "Omicron", "P1", "Rho",
<       NULL, "Sigma", "Tau", "Upsilon", "Ph1", "Ch1", "Ps1", "Omega",
---
>       "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho",
>       NULL, "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega",
144,145c144,145
<       "iota", "kappa", "lambda", "mu", "nu", "x1", "omicron", "p1", "rho",
<       "sigmaf", "sigma", "tau", "upsilon", "ph1", "ch1", "ps1", "omega",
---
>       "iota", "kappa", "lambda", "mu", "nu", "xi", "omicron", "pi", "rho",
>       "sigmaf", "sigma", "tau", "upsilon", "phi", "chi", "psi", "omega",

It's the same change in php-5 (with different line numbers)
 [2004-04-18 01:09 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.
 [2004-04-18 01:10 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2004-04-19 15:04 UTC] ben at csgb dot de
fixing summary line for better search results (entitity -> entity)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC