#50608 [Bgs]: last "<" character drops rest of the field with explode and preg_splits the
| From: | dlazesz at walla dot com | Date: | Wed, 30 Dec 2009 19:48:16 +0000 |
| Subject: | #50608 [Bgs]: last "<" character drops rest of the field with explode and preg_splits the | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-146215@lists.php.net to get a copy of this message | ||
ID: 50608
User updated by: dlazesz at walla dot com
Reported By: dlazesz at walla dot com
Status: Bogus
Bug Type: Strings related
Operating System: Ubuntu 9.10, Debian 4.0
PHP Version: 5.2.12
New Comment:
Thanks. I'd never thought of that.
There should be a big sign at http://bugs.php.net/how-to-report.php
"Also test in the command line!"
Previous Comments:
------------------------------------------------------------------------
[2009-12-30 00:30:50] johannes@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
Use your browser's View source function or the command line for a test
- the <> is treated like HTML by your browser ...
------------------------------------------------------------------------
[2009-12-29 23:34:30] dlazesz at walla dot com
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 this bug report at http://bugs.php.net/?id=50608&edit=1