]> granicus.if.org Git - php/commitdiff
Throw an error rather than silently changing to the default.
authorScott MacVicar <scottmac@php.net>
Thu, 14 May 2009 22:00:38 +0000 (22:00 +0000)
committerScott MacVicar <scottmac@php.net>
Thu, 14 May 2009 22:00:38 +0000 (22:00 +0000)
ext/json/json.c

index d9616ca7fd8a342dfea7c6b181dc1977e5cff32f..b8bcad21cf953c56154473b7ce228da04434b1a0 100644 (file)
@@ -536,7 +536,8 @@ static PHP_FUNCTION(json_decode)
        }
 
        if (depth <= 0) {
-               depth = JSON_PARSER_DEFAULT_DEPTH;
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must greater than zero.");
+               RETURN_NULL();
        }
 
        ALLOC_INIT_ZVAL(z);