#42186 [Opn->Fbk]: json_decode() won't work with \l
| From: | jani@php.net | Date: | Sat, 04 Aug 2007 14:17:56 +0000 |
| Subject: | #42186 [Opn->Fbk]: json_decode() won't work with \l | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115751@lists.php.net to get a copy of this message | ||
ID: 42186
Updated by: jani@php.net
Reported By: djlopez at gmx dot de
-Status: Open
+Status: Feedback
Bug Type: JSON related
Operating System: *
PHP Version: 5.2.3
New Comment:
Replace print_r() with var_dump() and you might actually see
something.
Previous Comments:
------------------------------------------------------------------------
[2007-08-02 18:47:06] djlopez at gmx dot de
Description:
------------
json_decode() returns nothing, when the string contains an \l
(lowercase L), maybe (internal) crash!?
Reproduce code:
---------------
$json = '{"stringwithbreak":"line with a \lbreak!"}';
print_r(json_decode($json, true));
Expected result:
----------------
print_r() is NOT returning anything, json_decode() seems to be not
executed.
Actual result:
--------------
Could be "solved" this way:
print_r(json_decode(str_replace("\\l", "", $json), true));
However, it's a bug...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42186&edit=1