#50608 [NEW]: last "<" character drops rest of the field with explode and preg_splits the
| From: | dlazesz at walla dot com | Date: | Tue, 29 Dec 2009 23:34:30 +0000 |
| Subject: | #50608 [NEW]: last "<" character drops rest of the field with explode and preg_splits the | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-146198@lists.php.net to get a copy of this message | ||
From: dlazesz at walla dot com
Operating system: Ubuntu 9.10, Debian 4.0
PHP version: 5.2.12
PHP Bug Type: Strings related
Bug description: last "<" character drops rest of the field with explode and
preg_splits the
Description:
------------
last "<" character drops the rest of the field with explode and preg_split
Reproduce code:
---------------
print_r(explode(",",'"Foo Bar" <foobar@example.com>, Second
address...'));
print_r(preg_split("/,/",'"Foo Bar" <foobar@example.com>, Second
address...'));
print_r(explode(",",'"Foo Bar" foobar@example.com>, Works.'));
print_r(preg_split("/,/",'"Foo Bar" foobar@example.com>, Works.'));
print_r(explode(",",'"Foo Bar" <<foobar@example.com>, Something
missing.'));
print_r(preg_split("/,/",'"Foo Bar" <<foobar@example.com>,
Something
missing.'));
Expected result:
----------------
Array ( [0] => "Foo Bar" <foobar@example.com> [1] => Second address... )
Array ( [0] => "Foo Bar" <foobar@example.com> [1] => Second address... )
Array ( [0] => "Foo Bar" foobar@example.com> [1] => Works. )
Array ( [0] => "Foo Bar" foobar@example.com> [1] => Works. )
Array ( [0] => "Foo Bar" <foobar@example.com> [1] => Something missing.
)
Array ( [0] => "Foo Bar" <foobar@example.com> [1] => Something missing. )
Actual result:
--------------
Array ( [0] => "Foo Bar" [1] => Second address... )
Array ( [0] => "Foo Bar" [1] => Second address... )
Array ( [0] => "Foo Bar" foobar@example.com> [1] => Works. )
Array ( [0] => "Foo Bar" foobar@example.com> [1] => Works. )
Array ( [0] => "Foo Bar" < [1] => Something missing. )
Array ( [0] => "Foo Bar" < [1] => Something missing. )
--
Edit bug report at http://bugs.php.net/?id=50608&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50608&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50608&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50608&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50608&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50608&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50608&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50608&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50608&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50608&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50608&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50608&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50608&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50608&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50608&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50608&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50608&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50608&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50608&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50608&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50608&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50608&r=mysqlcfg