From dfacfae34aafb1fdfb9f5042927236dac8c4b983 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 9 Apr 2008 08:55:45 +0000 Subject: [PATCH] Bug #44653 (Invalid namespace name resolution) --- Zend/tests/bug44653.phpt | 26 ++++++++++++++++++++++++++ Zend/zend_compile.c | 13 +++---------- 2 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 Zend/tests/bug44653.phpt 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) || -- 2.40.0