dmitry Wed Oct 17 10:36:45 2007 UTC Modified files: /php-src/ext/standard var_unserializer.c var_unserializer.re /php-src/ext/standard/tests/serialize bug42919.phpt Log: Fixed bug #42919 (Unserializing of namespaced class object fails) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.92&r2=1.93&diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.92 php-src/ext/standard/var_unserializer.c:1.93 --- php-src/ext/standard/var_unserializer.c:1.92 Sun Oct 7 05:15:06 2007 +++ php-src/ext/standard/var_unserializer.c Wed Oct 17 10:36:45 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.c,v 1.92 2007/10/07 05:15:06 davidw Exp $ */ +/* $Id: var_unserializer.c,v 1.93 2007/10/17 10:36:45 dmitry Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -641,7 +641,7 @@ if (UG(unicode)) { class_name.u = unserialize_ustr(&YYCURSOR, len); } else { - len3 = strspn((char*)YYCURSOR, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"); + len3 = strspn((char*)YYCURSOR, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:"); if (len3 != len) { *p = YYCURSOR + len3 - len; return 0; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.71&r2=1.72&diff_format=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.71 php-src/ext/standard/var_unserializer.re:1.72 --- php-src/ext/standard/var_unserializer.re:1.71 Sun Oct 7 05:15:06 2007 +++ php-src/ext/standard/var_unserializer.re Wed Oct 17 10:36:45 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.re,v 1.71 2007/10/07 05:15:06 davidw Exp $ */ +/* $Id: var_unserializer.re,v 1.72 2007/10/17 10:36:45 dmitry Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -701,7 +701,7 @@ if (UG(unicode)) { class_name.u = unserialize_ustr(&YYCURSOR, len); } else { - len3 = strspn((char*)YYCURSOR, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"); + len3 = strspn((char*)YYCURSOR, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:"); if (len3 != len) { *p = YYCURSOR + len3 - len; return 0; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/serialize/bug42919.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/standard/tests/serialize/bug42919.phpt diff -u /dev/null php-src/ext/standard/tests/serialize/bug42919.phpt:1.2 --- /dev/null Wed Oct 17 10:36:45 2007 +++ php-src/ext/standard/tests/serialize/bug42919.phpt Wed Oct 17 10:36:45 2007 @@ -0,0 +1,14 @@ +--TEST-- +Bug #42919 (Unserializing of namespaced class object fails) +--FILE-- +<?php +namespace Foo; +class Bar { +} +echo serialize(new Bar) . "\n"; +$x = unserialize(serialize(new Bar)); +echo get_class($x) . "\n"; +?> +--EXPECT-- +O:8:"Foo::Bar":0:{} +Foo::Bar
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php