From: Scott MacVicar Date: Tue, 6 Jul 2010 17:01:30 +0000 (+0000) Subject: Fix bug #52262 - Invalid UTF-8 documents don't set an error code when they fail to... X-Git-Tag: php-5.4.0alpha1~191^2~1206 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc74861cf82283c04a810bf306667e38dded4afb;p=php Fix bug #52262 - Invalid UTF-8 documents don't set an error code when they fail to decode. --- diff --git a/ext/json/json.c b/ext/json/json.c index 667774a911..e740415ab2 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -560,6 +560,7 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, if (utf16) { efree(utf16); } + JSON_G(error_code) = PHP_JSON_ERROR_UTF8; RETURN_NULL(); }