com php-src: Revert "json_decode() should generate a syntax error when given "".": ext/js on/json.c ext/json/tests/bug54484.phpt ext/js
on/tests/bug68938.phpt
| From: | JulienPauli | Date: | Wed, 04 Feb 2015 11:48:17 +0000 |
| Subject: | com php-src: Revert "json_decode() should generate a syntax error when given "".": ext/js on/json.c ext/json/tests/bug54484.phpt ext/js on/tests/bug68938.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84624@lists.php.net to get a copy of this message | ||
Commit: c85f12e3aca8d1da64504018e421a766ab66e574
Author: Julien Pauli <jpauli@php.net> Wed, 4 Feb 2015 12:48:17 +0100
Parents: 539fd6591591c78692848387210dcabb76b163f8
Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c85f12e3aca8d1da64504018e421a766ab66e574
Log:
Revert "json_decode() should generate a syntax error when given ""."
This reverts commit a7b3abe4e6f5e2fdfd8d55b676c9ca6b3f9c8cc8.
Changed paths:
M ext/json/json.c
M ext/json/tests/bug54484.phpt
D ext/json/tests/bug68938.phpt
Diff:
diff --git a/ext/json/json.c b/ext/json/json.c
index 27aed96..5b71eb0 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -818,7 +818,6 @@ static PHP_FUNCTION(json_decode)
JSON_G(error_code) = 0;
if (!str_len) {
- JSON_G(error_code) = PHP_JSON_ERROR_SYNTAX;
RETURN_NULL();
}
diff --git a/ext/json/tests/bug54484..phpt b/ext/json/tests/bug54484.phpt
index e56d8bd..d698ab5 100644
--- a/ext/json/tests/bug54484.phpt
+++ b/ext/json/tests/bug54484.phpt
@@ -15,16 +15,11 @@ json_decode("invalid json");
var_dump(json_last_error());
-json_decode("\001 invalid json");
-var_dump(json_last_error());
-
-
json_decode("");
var_dump(json_last_error());
?>
--EXPECT--
int(0)
+int(0)
int(4)
-int(4)
-int(3)
-int(4)
+int(0)
diff --git a/ext/json/tests/bug68938.phpt b/ext/json/tests/bug68938.phpt
deleted file mode 100644
index f6291ff..0000000
--- a/ext/json/tests/bug68938.phpt
+++ /dev/null
@@ -1,11 +0,0 @@
---TEST--
-Bug #68938 (json_decode() decodes empty string without indicating error)
---SKIPIF--
-<?php if (!extension_loaded("json")) print "skip"; ?>
---FILE--
-<?php
-json_decode("");
-var_dump(json_last_error());
-?>
---EXPECT--
-int(4)