mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
use zend_str_tolower_copy()
This commit is contained in:
parent
b5ca4de525
commit
d141ffd9de
1 changed files with 3 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue