]> granicus.if.org Git - php/commitdiff
Removed bogus code
authorIlia Alshanetsky <iliaa@php.net>
Thu, 5 Mar 2009 13:45:32 +0000 (13:45 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 5 Mar 2009 13:45:32 +0000 (13:45 +0000)
Zend/zend_builtin_functions.c

index 354fc9c6c88e5845ba8aa4b9cee125f7e68b2867..83adda99246d92c141c1e9c728668c81fd9f48ca 100644 (file)
@@ -627,40 +627,6 @@ ZEND_FUNCTION(define)
                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;
        }