]> granicus.if.org Git - php/commitdiff
use zend_str_tolower_copy()
authorSterling Hughes <sterling@php.net>
Wed, 21 May 2003 12:15:33 +0000 (12:15 +0000)
committerSterling Hughes <sterling@php.net>
Wed, 21 May 2003 12:15:33 +0000 (12:15 +0000)
Zend/zend_API.c

index 238bcbb6fa71230fe29027af4fe56d780463880f..dff717fb3d3f4e75695f74b2e4c41cc2ee3da748 100644 (file)
@@ -1541,8 +1541,7 @@ zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callabl
                        if (syntax_only)
                                return 1;
 
-                       lcname = estrndup(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
-                       zend_str_tolower(lcname, Z_STRLEN_P(callable));
+                       lcname = zend_str_tolower_copy(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
                        if (zend_hash_exists(EG(function_table), lcname, Z_STRLEN_P(callable)+1)) 
                                retval = 1;
                        efree(lcname);
@@ -1577,8 +1576,7 @@ zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callabl
                                                if (syntax_only)
                                                        return 1;
 
-                                               lcname = estrndup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
-                                               zend_str_tolower(lcname, Z_STRLEN_PP(obj));
+                                               lcname = zend_str_tolower_copy(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
                                                if (zend_lookup_class(lcname, Z_STRLEN_PP(obj), &pce TSRMLS_CC) == SUCCESS) {
                                                        ce = *pce;
                                                }
@@ -1604,8 +1602,7 @@ zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callabl
                                        }
 
                                        if (ce) {
-                                               lcname = estrndup(Z_STRVAL_PP(method), Z_STRLEN_PP(method));
-                                               zend_str_tolower(lcname, Z_STRLEN_PP(method));
+                                               lcname = zend_str_tolower_copy(Z_STRVAL_PP(method), Z_STRLEN_PP(method));
                                                if (zend_hash_exists(&ce->function_table, lcname, Z_STRLEN_PP(method)+1))
                                                        retval = 1;
                                                efree(lcname);