cvs: ZendEngine2(PHP_5_1) / zend_API.c /tests bug37138.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Thu, 20 Apr 2006 07:30:38 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_1) / zend_API.c /tests bug37138.phpt php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4823@lists.php.net to get a copy of this message | ||
dmitry Thu Apr 20 07:30:38 2006 UTC
Added files: (Branch: PHP_5_1)
/ZendEngine2/tests bug37138.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_API.c
Log:
Fixed bug #37138 (__autoload tries to load callback'ed self and parent)
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.521&r2=1.2027.2.522&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.521 php-src/NEWS:1.2027.2.522
--- php-src/NEWS:1.2027.2.521 Wed Apr 19 10:48:54 2006
+++ php-src/NEWS Thu Apr 20 07:30:37 2006
@@ -1,6 +1,8 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Apr 2006, PHP 5.1.3
+- Fixed bug #37138 (__autoload tries to load callback'ed self and parent).
+ (Dmitry)
- Fixed bug #37103 (libmbfl headers not installed). (Jani)
- Fixed bug #37083 (Frequent crashs in SOAP extension with new WSDL caching
code in multithread WS). (Andrei, Dmitry)
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.c?r1=1.296.2.26&r2=1.296.2.27&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.296.2.26 ZendEngine2/zend_API.c:1.296.2.27
--- ZendEngine2/zend_API.c:1.296.2.26 Thu Mar 23 13:14:55 2006
+++ ZendEngine2/zend_API.c Thu Apr 20 07:30:38 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.296.2.26 2006/03/23 13:14:55 helly Exp $ */
+/* $Id: zend_API.c,v 1.296.2.27 2006/04/20 07:30:38 dmitry Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -2039,18 +2039,16 @@
if ((colon = strstr(Z_STRVAL_P(callable), "::")) != NULL) {
clen = colon - Z_STRVAL_P(callable);
mlen = Z_STRLEN_P(callable) - clen - 2;
- if (zend_lookup_class(Z_STRVAL_P(callable), clen, &pce TSRMLS_CC) == SUCCESS) {
+ lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), clen);
+ /* caution: lcname is not '\0' terminated */
+ if (clen == sizeof("self") - 1 && memcmp(lcname, "self",
sizeof("self") - 1) == 0) {
+ *ce_ptr = EG(scope);
+ } else if (clen == sizeof("parent") - 1 && memcmp(lcname, "parent",
sizeof("parent") - 1) == 0 && EG(active_op_array)->scope) {
+ *ce_ptr = EG(scope) ? EG(scope)->parent : NULL;
+ } else if (zend_lookup_class(Z_STRVAL_P(callable), clen, &pce TSRMLS_CC) == SUCCESS) {
*ce_ptr = *pce;
- } else {
- lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), clen);
- /* caution: lcname is not '\0' terminated */
- if (clen == sizeof("self") - 1 && memcmp(lcname, "self",
sizeof("self") - 1) == 0) {
- *ce_ptr = EG(scope);
- } else if (clen == sizeof("parent") - 1 && memcmp(lcname, "parent",
sizeof("parent") - 1) == 0 && EG(active_op_array)->scope) {
- *ce_ptr = EG(scope) ? EG(scope)->parent : NULL;
- }
- efree(lcname);
}
+ efree(lcname);
if (!*ce_ptr) {
return 0;
}
@@ -2179,17 +2177,15 @@
return 1;
}
- if (zend_lookup_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), &pce TSRMLS_CC) == SUCCESS) {
+ lcname = zend_str_tolower_dup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
+ if (Z_STRLEN_PP(obj) == sizeof("self") - 1 && memcmp(lcname,
"self", sizeof("self")) == 0) {
+ ce = EG(active_op_array)->scope;
+ } else if (Z_STRLEN_PP(obj) == sizeof("parent") - 1 && memcmp(lcname,
"parent", sizeof("parent")) == 0 && EG(active_op_array)->scope) {
+ ce = EG(active_op_array)->scope->parent;
+ } else if (zend_lookup_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), &pce TSRMLS_CC) ==
SUCCESS) {
ce = *pce;
- } else if (EG(active_op_array)) {
- lcname = zend_str_tolower_dup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
- if (Z_STRLEN_PP(obj) == sizeof("self") - 1 && memcmp(lcname,
"self", sizeof("self")) == 0) {
- ce = EG(active_op_array)->scope;
- } else if (Z_STRLEN_PP(obj) == sizeof("parent") - 1 && memcmp(lcname,
"parent", sizeof("parent")) == 0 && EG(active_op_array)->scope) {
- ce = EG(active_op_array)->scope->parent;
- }
- efree(lcname);
}
+ efree(lcname);
} else {
ce = Z_OBJCE_PP(obj); /* TBFixed: what if it's overloaded? */
http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug37138.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug37138.phpt
+++ ZendEngine2/tests/bug37138.phpt