]> granicus.if.org Git - php/commitdiff
- Simplify (+fix memleak)
authorMarcus Boerger <helly@php.net>
Fri, 16 Dec 2005 23:58:38 +0000 (23:58 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 16 Dec 2005 23:58:38 +0000 (23:58 +0000)
ext/spl/php_spl.c

index e1cf0d0a2ca1e041a0150d4705259530b9c27d71..cb8241034d46ff28434eaeae16f89fed3aa829fc 100755 (executable)
@@ -393,9 +393,7 @@ PHP_FUNCTION(spl_autoload_register)
        if (ZEND_NUM_ARGS()) {
                if (Z_TYPE_P(zcallable) == IS_STRING) {
                        if (Z_STRLEN_P(zcallable) == sizeof("spl_autoload_call") - 1) {
-                               char tmp_name[sizeof("spl_autoload_call")];
-                               zend_str_tolower_copy(tmp_name, Z_STRVAL_P(zcallable), Z_STRLEN_P(zcallable));
-                               if (!strcmp(tmp_name, "spl_autoload_call")) {
+                               if (!zend_binary_strcasecmp(Z_STRVAL_P(zcallable), sizeof("spl_autoload_call"), "spl_autoload_call", sizeof("spl_autoload_call"))) {
                                        if (do_throw) {
                                                zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function spl_autoload_call() cannot be registered");
                                        }