summaryrefslogtreecommitdiff
path: root/xcache
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-11-10 13:24:52 +0000
committerXuefer <xuefer@gmail.com>2014-11-10 13:24:52 +0000
commit49e586053c40eb367f90a464818111df867c0625 (patch)
tree2cc793a1e1ef851ab9b95689e7195ee69815c5e7 /xcache
parent51accff949c03c54a1f5fef4c54e2aa61feb00ba (diff)
downloadxcache-49e586053c40eb367f90a464818111df867c0625.tar.gz
xcache-49e586053c40eb367f90a464818111df867c0625.zip
PHP4: fix object handling
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1562 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'xcache')
-rw-r--r--xcache/xc_utils.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/xcache/xc_utils.c b/xcache/xc_utils.c
index 244d015..48db730 100644
--- a/xcache/xc_utils.c
+++ b/xcache/xc_utils.c
@@ -647,13 +647,21 @@ zend_class_entry *xc_lookup_class(const char *class_name, int class_name_len, ze
}
#elif defined(ZEND_ENGINE_2)
if (zend_lookup_class_ex(class_name, class_name_len, autoload, &cest TSRMLS_CC) != SUCCESS) {
- return NULL;
+ cest = NULL;
}
#else
- if (zend_hash_find(EG(class_table), class_name, class_name_len, (void **) &cest) != SUCCESS) {
- return NULL;
+ char *lc_class_name;
+ ALLOCA_FLAG(use_heap);
+
+ lc_class_name = xc_do_alloca(sizeof(*class_name) * (class_name_len + 1), use_heap);
+ strcpy(lc_class_name, class_name);
+ zend_str_tolower(lc_class_name, class_name_len);
+
+ if (zend_hash_find(EG(class_table), lc_class_name, class_name_len + 1, (void **) &cest) != SUCCESS) {
+ cest = NULL;
}
+ xc_free_alloca(lc_class_name, use_heap);
#endif
- return CestToCePtr(*cest);
+ return cest ? CestToCePtr(*cest) : NULL;
}
/* }}} */