From: Dmitry Stogov Date: Wed, 17 Oct 2007 10:36:33 +0000 (+0000) Subject: Fixed bug #42919 (Unserializing of namespaced class object fails) X-Git-Tag: RELEASE_1_3_1~836 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb0991bb85ace61615935520fefd3f8917b37919;p=php Fixed bug #42919 (Unserializing of namespaced class object fails) --- diff --git a/NEWS b/NEWS index 2957842c3a..2987f39a0e 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,7 @@ PHP NEWS - Improved and cleaned CGI code. FastCGI is now always enabled and can not be disabled. See sapi/cgi/CHANGES for more details. (Dmitry) +- Fixed bug #42919 (Unserializing of namespaced class object fails). (Dmitry) - Fixed bug #42859 (import always conflicts with internal classes). (cellog@php.net, Dmitry) - Fixed bug #42820 (defined() on constant with namespace prefixes tries to load diff --git a/ext/standard/tests/serialize/bug42919.phpt b/ext/standard/tests/serialize/bug42919.phpt new file mode 100755 index 0000000000..11cb81de6c --- /dev/null +++ b/ext/standard/tests/serialize/bug42919.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #42919 (Unserializing of namespaced class object fails) +--FILE-- + +--EXPECT-- +O:8:"Foo::Bar":0:{} +Foo::Bar diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 11bf3a5004..64a2e238b0 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -581,7 +581,7 @@ yy20: return 0; } - len3 = strspn(class_name, "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(class_name, "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; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 3800c67f2f..7356e2406e 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -617,7 +617,7 @@ object ":" uiv ":" ["] { return 0; } - len3 = strspn(class_name, "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(class_name, "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;