php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43774 json_decode cause notices when called with non json data
Submitted: 2008-01-06 23:34 UTC Modified: 2008-01-15 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: marcin dot krzyzanowski at gmail dot com Assigned:
Status: No Feedback Package: JSON related
PHP Version: 5.2.5 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marcin dot krzyzanowski at gmail dot com
New email:
PHP Version: OS:

 

 [2008-01-06 23:34 UTC] marcin dot krzyzanowski at gmail dot com
Description:
------------
I think that json_decode have problem with incorrect data passed as parameter;

Reproduce code:
---------------
$post = " ";
$data = json_decode($post);
some other code here

Expected result:
----------------
empty $data or similar

Actual result:
--------------
for every line of code below (even if it's commented out) will show

Notice: Trying to get property of non-object in file.php on line 54
Notice: Trying to get property of non-object in file.php on line 55
etc..

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 23:01:34 2019 UTC