Edit report at http://bugs.php.net/bug.php?id=50106&edit=1
ID: 50106 Comment by: technik at thomas-heuer dot eu Reported by: bugzilla33 at gmail dot com Summary: htmlspecialchars is inconsistent with the specification Status: Bogus Type: Bug Package: Strings related Operating System: All PHP Version: 5.3.1RC3 Block user comment: N Private report: N New Comment: Well, if this is not a bug, please turn into a feature-request. Previous Comments: ------------------------------------------------------------------------ [2009-11-09 17:12:13] j...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ [2009-11-06 21:37:42] bugzilla33 at gmail dot com Description: ------------ When use HTML 5 widt <!DOCTYPE html> we must encode only widt &#xx; It is not supported entity like: &" etc When mime type is application/xhtml+xml and <!DOCTYPE html> browser halt xml parsing on &" etc http://pl.php.net/manual/en/function.htmlspecialchars.php http://pl.php.net/manual/en/function.htmlentities.php Reproduce code: --------------- <?=htmlspecialchars('&')?> Expected result: ---------------- '&' (ampersand) becomes '&' '"' (double quote) becomes '"' ''' (single quote) becomes ''' '<' (less than) becomes '<' '>' (greater than) becomes '>' Actual result: -------------- '&' (ampersand) becomes '&' '"' (double quote) becomes '"' ''' (single quote) becomes ''' '<' (less than) becomes '<' '>' (greater than) becomes '>' ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=50106&edit=1