Bug #65132 [NEW]: trim does not include non breaking whitespace
| From: | daniel at 203core dot se | Date: | Wed, 26 Jun 2013 08:19:50 +0000 |
| Subject: | Bug #65132 [NEW]: trim does not include non breaking whitespace | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-179837@lists.php.net to get a copy of this message | ||
From: daniel at 203core dot se
Operating system: FreeBSD 9.1
PHP version: 5.4.16
Package: Scripting Engine problem
Bug Type: Bug
Bug description:trim does not include non breaking whitespace
Description:
------------
If a line contains a non-breaking white space (\xA0) trim doesnt strip it,
it should as its a "space" character
This can easily be bypassed by sending the \xA0 character in the option
parameter but it took a while to figure out there was a non-breaking space
character in the string
Test script:
---------------
<?php
$string = " \xA0";
echo strlen(trim($string));
Expected result:
----------------
the script should output a length of 0
Actual result:
--------------
The script outputs a length of 1 as trim doesnt strip the non breaking
space
--
Edit bug report at https://bugs.php.net/bug.php?id=65132&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65132&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65132&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65132&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65132&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65132&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65132&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65132&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65132&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65132&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65132&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65132&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65132&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65132&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65132&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65132&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65132&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65132&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65132&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65132&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65132&r=mysqlcfg