]> granicus.if.org Git - php/commitdiff
Fix bug #52262 - Invalid UTF-8 documents don't set an error code when they fail to...
authorScott MacVicar <scottmac@php.net>
Tue, 6 Jul 2010 17:01:30 +0000 (17:01 +0000)
committerScott MacVicar <scottmac@php.net>
Tue, 6 Jul 2010 17:01:30 +0000 (17:01 +0000)
NEWS
ext/json/json.c

diff --git a/NEWS b/NEWS
index b524920baaada35d26d110bb607bb49f17032743..cac6209eff9794875db3b540f63415db2a4b4e34 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Jul 2010, PHP 5.3.3 RC3
+- Fixed bug #52262 (json_decode() shows no errors on invalid UTF-8).
+  (Scott)
 - Fixed bug #52240 (hash_copy() does not copy the HMAC key, causes wrong
   results and PHP crashes). (Felipe)
 - Fixed bug #52238 (Crash when an Exception occured in iterator_to_array).
index 09e874040afa9c1ab533e3bf195dc8739f8b9292..38fd3aacfae51b7392edeff314da3f83fdbdcd67 100644 (file)
@@ -500,6 +500,7 @@ PHP_JSON_API void php_json_decode(zval *return_value, char *str, int str_len, ze
                if (utf16) {
                        efree(utf16);
                }
+               JSON_G(error_code) = PHP_JSON_ERROR_UTF8;
                RETURN_NULL();
        }