php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5666 htmlentities & htmlspecialchars don't work
Submitted: 2000-07-18 13:35 UTC Modified: 2000-07-24 09:12 UTC
From: enrico at efc dot it Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.1pl2 OS: Solaris 8
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: enrico at efc dot it
New email:
PHP Version: OS:

 

 [2000-07-18 13:35 UTC] enrico at efc dot it
When I use htmlentities & htmlspecialchars function (Php4.0.1pl2+Solaris8+Apache1.3.12) they don't work, they don't translate any character.
Then I call the get_html_translation_table() function and it returns an array with the key equal to the value for each pair.
I think the problem is here, since the above 2 functions use this one.
 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-19 08:31 UTC] stas at cvs dot php dot net
Couldn't reporoduce this. Please explain with script example what you were doing.
 [2000-07-19 09:06 UTC] enrico at efc dot it
<?
    $a = get_html_translation_table( HTML_SPECIAL_CHARS );
    while( $val=each($a) )
        echo $val[0]." -> ".$val[1]."<br>";
?>

Give as result:
 & -> &
 " -> "
 < -> <
 > -> >

and the same occurs using HTML_ENTITIES.
As conseguence, when I use htmlentities() or htmlspecialchars() no translation occurs.
For example:

 echo htmlspecialchars( "1 < 2" );
returns
 "1 < 2"

 [2000-07-19 09:08 UTC] stas at cvs dot php dot net
it works perfectly for me. Do you use command-line version?
 [2000-07-19 09:18 UTC] enrico at efc dot it
I've compiled Php4.0.1pl2 as a Apache1.3.12 module, so I'm doing all these tests requesting pages to the Web Server.
I've had the same troubles also with 4.0.0 (I've installed the latest release with the hope to find a bug fix to it).
To compile I've used 
  make-3.79
  gcc-2.95.2
(Solaris8 packages downloaded from SunFreeWare.com).

 [2000-07-19 09:24 UTC] stas at cvs dot php dot net
Sorry for asking that, but do you look at _source_ in your browser?
 [2000-07-24 09:12 UTC] stas@php.net
no feedback
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 15:01:35 2025 UTC