mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
minor changes in iconv_substr() to avoid zval converting
This commit is contained in:
parent
73fbbb48ec
commit
32ff2a16fe
@ -1886,7 +1886,6 @@ PHP_FUNCTION(iconv_substr)
|
||||
char *str;
|
||||
int str_len;
|
||||
long offset, length;
|
||||
zval *len_z = NULL;
|
||||
|
||||
php_iconv_err_t err;
|
||||
|
||||
@ -1894,17 +1893,14 @@ PHP_FUNCTION(iconv_substr)
|
||||
|
||||
charset = ICONVG(internal_encoding);
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|zs",
|
||||
&str, &str_len, &offset, &len_z,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls",
|
||||
&str, &str_len, &offset, &length,
|
||||
&charset, &charset_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (len_z == NULL) {
|
||||
if (ZEND_NUM_ARGS() < 3) {
|
||||
length = str_len;
|
||||
} else {
|
||||
convert_to_long_ex(&len_z);
|
||||
length = Z_LVAL_P(len_z);
|
||||
}
|
||||
|
||||
err = _php_iconv_substr(&retval, str, str_len, offset, length, charset);
|
||||
|
Loading…
Reference in New Issue
Block a user