cvs: ZendEngine2(PHP_5_3) / zend_builtin_functions.c

From: Date: Wed, 22 Oct 2008 23:28:34 +0000
Subject: cvs: ZendEngine2(PHP_5_3) / zend_builtin_functions.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-7167@lists.php.net to get a copy of this message
iliaa Wed Oct 22 23:28:34 2008 UTC Modified files: (Branch: PHP_5_3) /ZendEngine2 zend_builtin_functions.c Log: Revert define() fix, it needs further review http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.277.2.12.2.25.2.30&r2=1.277.2.12.2.25.2.31&diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.25.2.30 ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.25.2.31 --- ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.25.2.30 Sun Oct 19 18:07:37 2008 +++ ZendEngine2/zend_builtin_functions.c Wed Oct 22 23:28:34 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.25.2.30 2008/10/19 18:07:37 iliaa Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.25.2.31 2008/10/22 23:28:34 iliaa Exp $ */ #include "zend.h" #include "zend_API.h" @@ -26,7 +26,6 @@ #include "zend_ini.h" #include "zend_exceptions.h" #include "zend_extensions.h" -#include <ctype.h> #undef ZEND_TEST_EXCEPTIONS @@ -718,7 +717,7 @@ Define a new constant */ ZEND_FUNCTION(define) { - char *name, *p; + char *name; int name_len; zval *val; zval *val_free = NULL; @@ -730,40 +729,6 @@ return; } - /* check if class constant */ - if ((p = memchr(name, ':', name_len))) { - char *s = name; - zend_class_entry **ce; - - if (*(p + 1) != ':') { /* invalid constant specifier */ - RETURN_FALSE; - } else if ((p + 2) >= (name + name_len)) { /* constant name length < 1 */ - zend_error(E_WARNING, "Constants name cannot be empty"); - RETURN_FALSE; - } else if (zend_lookup_class(s, (p - s), &ce TSRMLS_CC) != SUCCESS) { /* invalid class name */ - zend_error(E_WARNING, "Class does not exists"); - RETURN_FALSE; - } else { /* check of constant name contains invalid chars */ - int ok = 1; - p += 2; /* move beyond :: to 1st char of constant's name */ - - if (!isalpha(*p) && *p != '_') { - ok = 0; - } - - while (ok && *++p) { - if (!isalnum(*p) && *p != '_') { - ok = 0; - break; - } - } - - if (!ok) { - RETURN_FALSE; - } - } - } - if(non_cs) { case_sensitive = 0; }

« previous php.zend-engine.cvs (#7167) next »