diff options
| author | Dmitry Stogov <dmitry@php.net> | 2007-10-17 10:36:45 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2007-10-17 10:36:45 +0000 |
| commit | 6fc398fba98f99e67f075cd883ae9f1dc451e51f (patch) | |
| tree | b9cb49108ff9ea9c9c7965720c9509aaf9e7dbfb /ext | |
| parent | 8cae2e56e4dc5f9a138e237b89937ac1b16d5fe1 (diff) | |
| download | php-git-6fc398fba98f99e67f075cd883ae9f1dc451e51f.tar.gz | |
Fixed bug #42919 (Unserializing of namespaced class object fails)
Diffstat (limited to 'ext')
| -rwxr-xr-x | ext/standard/tests/serialize/bug42919.phpt | 14 | ||||
| -rw-r--r-- | ext/standard/var_unserializer.c | 2 | ||||
| -rw-r--r-- | ext/standard/var_unserializer.re | 2 |
3 files changed, 16 insertions, 2 deletions
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-- +<?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 diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 9ca6c54b36..18fc14be16 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -641,7 +641,7 @@ yy21: 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; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 15daf57261..b50e2e5032 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -701,7 +701,7 @@ object ":" uiv ":" ["] { 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; |
