php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #45865 incorrect values returned by htmlspecialchars_decode
Submitted: 2008-08-19 23:46 UTC Modified: 2008-08-19 23:56 UTC
From: firealwaysworks at gmail dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: firealwaysworks at gmail dot com
New email:
PHP Version: OS:

 

 [2008-08-19 23:46 UTC] firealwaysworks at gmail dot com
Description:
------------
As I understand it htmlspecialchars_decode is the inverse of htmlspecialchars.  The bug is that not all characters are inverted properly.

Thanks,
Michael 

Reproduce code:
---------------
<?php
echo "\n".htmlspecialchars_decode(htmlspecialchars("'",ENT_QUOTES));
echo "\n".htmlspecialchars_decode(htmlspecialchars('"',ENT_QUOTES));
?>

Expected result:
----------------
'
"

Actual result:
--------------
&#039;
"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-19 23:56 UTC] felipe@php.net
There is no some bug in this behavior.
Read: http://docs.php.net/htmlspecialchars_decode

Thanks.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 30 01:00:02 2025 UTC