]> granicus.if.org Git - php/commitdiff
- Fixed bug #50731 (Inconsistent namespaces sent to functions registered with spl_aut...
authorFelipe Pena <felipe@php.net>
Wed, 3 Mar 2010 00:15:34 +0000 (00:15 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 3 Mar 2010 00:15:34 +0000 (00:15 +0000)
NEWS
Zend/tests/bug46665.phpt
Zend/zend_execute_API.c

diff --git a/NEWS b/NEWS
index 699910e7281aebb130e455ca85d267711f03c2ab..6cfddd517e6888af870ea30c04542124ca627816 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -96,6 +96,8 @@ PHP                                                                        NEWS
   (hiroaki dot kawai at gmail dot com, Ilia)
 - Fixed bug #50756 (CURLOPT_FTP_SKIP_PASV_IP does not exist). (Sriram)
 - Fixed bug #50732 (exec() adds single byte twice to $output array). (Ilia)
+- Fixed bug #50731 (Inconsistent namespaces sent to functions registered with
+  spl_autoload_register). (Felipe)
 - Fixed bug #50728 (All PDOExceptions hardcode 'code' property to 0).
   (Joey, Ilia)
 - Fixed bug #50723 (Bug in garbage collector causes crash). (Dmitry)
index 8e7fc086dd6b25d6114997ab8ed9fe2bcd513227..1f82454387f467d4f8e107fca1278ccdf49021f2 100644 (file)
@@ -12,4 +12,4 @@ function __autoload($class) {
 
 ?>
 --EXPECTF--
-%string|unicode%(12) "\Foo\Bar\Baz"
+%string|unicode%(11) "Foo\Bar\Baz"
index f73df65e2aef573f0948077cbeadc8023b241056..55d0ab72cad6642dd69254d6b108a29be873e72a 100644 (file)
@@ -1076,7 +1076,11 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_aut
 
        ALLOC_ZVAL(class_name_ptr);
        INIT_PZVAL(class_name_ptr);
-       ZVAL_STRINGL(class_name_ptr, name, name_length, 1);
+       if (name[0] == '\\') {
+               ZVAL_STRINGL(class_name_ptr, name+1, name_length-1, 1);
+       } else {
+               ZVAL_STRINGL(class_name_ptr, name, name_length, 1);
+       }
 
        args[0] = &class_name_ptr;