php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch self-parent-static-token-case-insensitive for Scripting Engine problem Bug #60833

Patch version 2012-01-21 20:32 UTC

Return to Bug #60833 | Download this patch
Patch Revisions:

Developer: mario@include-once.org

--- Zend/zend_compile.old	2012-01-21 20:50:27.254382491 +0100
+++ Zend/zend_compile.c	2012-01-21 20:52:20.374943387 +0100
@@ -6822,13 +6822,13 @@
 int zend_get_class_fetch_type(const char *class_name, uint class_name_len) /* {{{ */
 {
 	if ((class_name_len == sizeof("self")-1) &&
-		!memcmp(class_name, "self", sizeof("self")-1)) {
+		!strncasecmp(class_name, "self", sizeof("self")-1)) {
 		return ZEND_FETCH_CLASS_SELF;		
 	} else if ((class_name_len == sizeof("parent")-1) &&
-		!memcmp(class_name, "parent", sizeof("parent")-1)) {
+		!strncasecmp(class_name, "parent", sizeof("parent")-1)) {
 		return ZEND_FETCH_CLASS_PARENT;
 	} else if ((class_name_len == sizeof("static")-1) &&
-		!memcmp(class_name, "static", sizeof("static")-1)) {
+		!strncasecmp(class_name, "static", sizeof("static")-1)) {
 		return ZEND_FETCH_CLASS_STATIC;
 	} else {
 		return ZEND_FETCH_CLASS_DEFAULT;
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 05:03:19 2014 UTC