Req #66766 [NEW]: htmlspecialchars() request
| From: | sillywilly at hotmail dot com | Date: | Tue, 25 Feb 2014 00:32:23 +0000 |
| Subject: | Req #66766 [NEW]: htmlspecialchars() request | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-184399@lists.php.net to get a copy of this message | ||
From: sillywilly at hotmail dot com
Operating system:
PHP version: Irrelevant
Package: Unknown/Other Function
Bug Type: Feature/Change Request
Bug description:htmlspecialchars() request
Description:
------------
htmlspecialchars() and other such functions returns an empty string in
PHP 5.4 and above when Latin1 characters are passed. Where in previous
versions Latin1 characters were expected as the default. This makes
upgrading to PHP 5.4 difficult because it breaks backward-compatibility.
When in fact this function should continue to work normally. See below.
Expected result:
----------------
You should not need to specify what your character set is for this
function as long as ASCII is a subset of the character set. (Examples:
UTF-8, cp1252, etc) as the search and replace behavior is the same for
all such character sets. You should only need to specify your specific
character set if ASCII isn't a subset character set so that the search
and replace behavior can be adjusted. That would be an improvement and
would make legacy use of htmlspecialchars() that expects it to work on
latin1 characters backward compatible. As it is now, most people are
writing their own functions for backward compatibility rather than
passing as a parameter that they're still using the Latin1 charset. This
is annoying because there's no reason that this function needs to stop
working in the first place.
Actual result:
--------------
this function returns an empty string when latin1 characters are passed.
People upgrading to PHP 5.4 wind up with broken code, and are forced to
debug.
--
Edit bug report at https://bugs.php.net/bug.php?id=66766&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66766&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66766&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66766&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66766&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66766&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66766&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66766&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66766&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66766&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66766&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66766&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66766&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66766&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66766&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66766&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66766&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66766&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66766&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66766&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66766&r=mysqlcfg