From: Dmitry Stogov Date: Wed, 9 Apr 2008 08:55:45 +0000 (+0000) Subject: Bug #44653 (Invalid namespace name resolution) X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~411 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfacfae34aafb1fdfb9f5042927236dac8c4b983;p=php Bug #44653 (Invalid namespace name resolution) --- diff --git a/Zend/tests/bug44653.phpt b/Zend/tests/bug44653.phpt new file mode 100644 index 0000000000..defdba810a --- /dev/null +++ b/Zend/tests/bug44653.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #44653 (Invalid namespace name resolution) +--FILE-- + +--EXPECT-- +int(1) +A::fooBar +B::fooBar +B::fooBar diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 927162af6b..82fec6c303 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1597,16 +1597,9 @@ void zend_resolve_class_name(znode *class_name, ulong *fetch_type, int check_ns_ zend_class_entry **pce; if (check_ns_name) { - char *ns_lcname = zend_str_tolower_dup(Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace))); - - if (Z_STRLEN_P(CG(current_namespace)) == Z_STRLEN(class_name->u.constant) && - memcmp(lcname, ns_lcname, Z_STRLEN(class_name->u.constant)) == 0) { - /* The given name is equal to name of current namespace. - PHP will need to perform additional cheks at run-time to - determine if we assume namespace or class name. */ - *fetch_type |= ZEND_FETCH_CLASS_RT_NS_NAME; - } - efree(ns_lcname); + /* PHP will need to perform additional cheks at run-time to + determine if we assume namespace or class name. */ + *fetch_type |= ZEND_FETCH_CLASS_RT_NS_NAME; } if ((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) ||