iliaa           Thu Apr 12 19:40:38 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/json/tests     bug41034.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/json   json.c 
    /php-src/ext/json/tests     002.phpt 
  Log:
  
  Fixed bug #41034 (json_encode() ignores null byte started keys in arrays)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.640&r2=1.2027.2.547.2.641&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.640 php-src/NEWS:1.2027.2.547.2.641
--- php-src/NEWS:1.2027.2.547.2.640     Thu Apr 12 18:39:45 2007
+++ php-src/NEWS        Thu Apr 12 19:40:38 2007
@@ -4,6 +4,8 @@
 - Fixed bug #41063 (chdir doesn't like root paths). (Dmitry)
 - Fixed bug #41061 ("visibility error" in ReflectionFunction::export()).
   (Johannes)
+- Fixed bug #41034 (json_encode() ignores null byte started keys in arrays).
+  (Ilia)
 - Fixed bug #40861 (strtotime() doesn't handle double negative relative time
   units correctly). (Derick)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.9.2.12&r2=1.9.2.13&diff_format=u
Index: php-src/ext/json/json.c
diff -u php-src/ext/json/json.c:1.9.2.12 php-src/ext/json/json.c:1.9.2.13
--- php-src/ext/json/json.c:1.9.2.12    Sun Feb 18 16:54:59 2007
+++ php-src/ext/json/json.c     Thu Apr 12 19:40:38 2007
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: json.c,v 1.9.2.12 2007/02/18 16:54:59 iliaa Exp $ */
+/* $Id: json.c,v 1.9.2.13 2007/04/12 19:40:38 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -177,7 +177,7 @@
                     json_encode_r(buf, *data TSRMLS_CC);
                 } else if (r == 1) {
                     if (i == HASH_KEY_IS_STRING) {
-                        if (key[0] == '\0') {
+                        if (key[0] == '\0' && Z_TYPE_PP(val) == IS_OBJECT) {
                             /* Skip protected and private members. */
                             continue;
                         }
http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/002.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/json/tests/002.phpt
diff -u php-src/ext/json/tests/002.phpt:1.1.2.2 
php-src/ext/json/tests/002.phpt:1.1.2.3
--- php-src/ext/json/tests/002.phpt:1.1.2.2     Thu Jul 20 08:56:57 2006
+++ php-src/ext/json/tests/002.phpt     Thu Apr 12 19:40:38 2007
@@ -21,7 +21,7 @@
 string(2) """"
 string(4) "null"
 string(4) "true"
-string(2) "{}"
+string(7) "{"":""}"
 string(5) "[[1]]"
 string(1) "1"
 string(38) ""\u0440\u0443\u0441\u0441\u0438\u0448""

http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/bug41034.phpt?view=markup&rev=1.1
Index: php-src/ext/json/tests/bug41034.phpt
+++ php-src/ext/json/tests/bug41034.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to