summaryrefslogtreecommitdiff
path: root/ext/json/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/json.c')
-rw-r--r--ext/json/json.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/json/json.c b/ext/json/json.c
index 42721edac6..a30d13ed36 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -494,7 +494,7 @@ static PHP_FUNCTION(json_decode)
char *str;
int str_len, utf16_len;
zend_bool assoc = 0; /* return JS objects as PHP objects by default */
- long depth = JSON_PARSER_MAX_DEPTH;
+ long depth = JSON_PARSER_DEFAULT_DEPTH;
zval *z;
unsigned short *utf16;
JSON_parser jp;
@@ -517,9 +517,9 @@ static PHP_FUNCTION(json_decode)
RETURN_NULL();
}
- /* can be removed once we remove the max depth limit */
- if (depth <= 0 || depth > JSON_PARSER_MAX_DEPTH) {
- depth = JSON_PARSER_MAX_DEPTH;
+ if (depth <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must greater than zero.");
+ RETURN_NULL();
}
ALLOC_INIT_ZVAL(z);