Add initial failure checking for json_encode

This commit is contained in:
Jakub Zelenka 2016-08-24 20:46:33 +01:00
parent 0e709fe42d
commit 12a8c3f6e7
3 changed files with 57 additions and 43 deletions

View file

@ -186,9 +186,7 @@ static PHP_MINFO_FUNCTION(json)
PHP_JSON_API int php_json_encode(smart_str *buf, zval *val, int options) /* {{{ */
{
php_json_encode_zval(buf, val, options);
return JSON_G(error_code) > 0 ? FAILURE : SUCCESS;
return php_json_encode_zval(buf, val, options);
}
/* }}} */