php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50118 htmlspecialchars parsing HTML5+XML
Submitted: 2009-11-09 08:32 UTC Modified: 2009-11-09 15:19 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: floder at gmail dot com Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.3.1RC3 OS: all
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: floder at gmail dot com
New email:
PHP Version: OS:

 

 [2009-11-09 08:32 UTC] floder at gmail dot com
Description:
------------
Problem with htmlspecialchars PHP function.
In HTML5 are allowed only numeric entities. 
In XML parsing mode browser interrupts errors. 

Reproduce code:
---------------
<=htmlspecialchars('&')>

Expected result:
----------------
??'&' (ampersand) becomes '&#38;' 
??'"' (double quote) becomes '&#34;' 
??''' (single quote) becomes '&#39;' 
??'<' (less than) becomes '&#60;' 
??'>' (greater than) becomes '&#62;' 

Actual result:
--------------
??'&' (ampersand) becomes '&amp;' 
??'"' (double quote) becomes '&quot;'
??''' (single quote) becomes '&#039;'
??'<' (less than) becomes '&lt;' 
??'>' (greater than) becomes '&gt;' 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-09 15:19 UTC] scottmac@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Duplicate of bug #50106
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Aug 26 00:01:26 2019 UTC