|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-08-02 18:47 UTC] 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...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
Another "bug": $json = '{"titel":"Trance","desc":"Trance%0ADJ"}'; var_dump(json_decode(urldecode($json), true)); Afaik %0A is urlencoded for \n. json_decode() is returning NULL here also! And this should be a bug...