From 3e7fc1607823fda6134bf750e4d57c487c82ee4f Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 9 Apr 2008 08:55:31 +0000 Subject: [PATCH] Bug #44653 (Invalid namespace name resolution) --- Zend/tests/bug44653.phpt | 26 ++++++++++++++++++++++++++ Zend/zend_compile.c | 14 +++----------- 2 files changed, 29 insertions(+), 11 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 b821e53650..193af49c08 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1756,17 +1756,9 @@ void zend_resolve_class_name(znode *class_name, ulong *fetch_type, int check_ns_ zend_class_entry **pce; if (check_ns_name) { - unsigned int ns_lcname_len; - zstr ns_lcname = zend_u_str_case_fold(Z_TYPE_P(CG(current_namespace)), Z_UNIVAL_P(CG(current_namespace)), Z_UNILEN_P(CG(current_namespace)), 0, &ns_lcname_len); - - if (ns_lcname_len == lcname_len && - memcmp(lcname.v, ns_lcname.v, UG(unicode)?UBYTES(lcname_len):lcname_len) == 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.v); + /* 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.50.1