diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 36c5da61717..f99ceea4180 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -562,7 +562,7 @@ static char *php_mb_rfc1867_substring_conf(const zend_encoding *encoding, char * if (start[i] == '\\' && (start[i + 1] == '\\' || (quote && start[i + 1] == quote))) { *resp++ = start[++i]; } else { - size_t j = php_mb_mbchar_bytes_ex(start+i, (const mbfl_encoding *)encoding); + size_t j = php_mb_mbchar_bytes(start+i, (const mbfl_encoding *)encoding); while (j-- > 0 && i < len) { *resp++ = start[i++]; @@ -594,7 +594,7 @@ static char *php_mb_rfc1867_getword(const zend_encoding *encoding, char **line, ++pos; } } else { - pos += php_mb_mbchar_bytes_ex(pos, (const mbfl_encoding *)encoding); + pos += php_mb_mbchar_bytes(pos, (const mbfl_encoding *)encoding); } } @@ -607,7 +607,7 @@ static char *php_mb_rfc1867_getword(const zend_encoding *encoding, char **line, res = estrndup(*line, pos - *line); while (*pos == stop) { - pos += php_mb_mbchar_bytes_ex(pos, (const mbfl_encoding *)encoding); + pos += php_mb_mbchar_bytes(pos, (const mbfl_encoding *)encoding); } *line = pos; @@ -4203,8 +4203,7 @@ static int php_mb_encoding_translation(void) } /* }}} */ -/* {{{ MBSTRING_API size_t php_mb_mbchar_bytes_ex() */ -MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc) +MBSTRING_API size_t php_mb_mbchar_bytes(const char *s, const mbfl_encoding *enc) { if (enc) { if (enc->mblen_table) { @@ -4219,14 +4218,6 @@ MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *e } return 1; } -/* }}} */ - -/* {{{ MBSTRING_API size_t php_mb_mbchar_bytes() */ -MBSTRING_API size_t php_mb_mbchar_bytes(const char *s) -{ - return php_mb_mbchar_bytes_ex(s, MBSTRG(internal_encoding)); -} -/* }}} */ MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc) { @@ -4241,7 +4232,7 @@ MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nby if ((unsigned char)*p == (unsigned char)c) { last = (char *)p; } - nb = php_mb_mbchar_bytes_ex(p, enc); + nb = php_mb_mbchar_bytes(p, enc); if (nb == 0) { return NULL; /* something is going wrong! */ } @@ -4256,7 +4247,7 @@ MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nby if ((unsigned char)*p == (unsigned char)c) { last = (char *)p; } - nbytes_char = php_mb_mbchar_bytes_ex(p, enc); + nbytes_char = php_mb_mbchar_bytes(p, enc); if (bcnt < nbytes_char) { return NULL; } diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h index 05016aa08dd..82b28dbef00 100644 --- a/ext/mbstring/mbstring.h +++ b/ext/mbstring/mbstring.h @@ -62,8 +62,7 @@ MBSTRING_API char * php_mb_convert_encoding( const char *input, size_t length, const mbfl_encoding *to_encoding, const mbfl_encoding **from_encodings, size_t num_from_encodings, size_t *output_len); -MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc); -MBSTRING_API size_t php_mb_mbchar_bytes(const char *s); +MBSTRING_API size_t php_mb_mbchar_bytes(const char *s, const mbfl_encoding *enc); MBSTRING_API size_t php_mb_stripos(int mode, const char *old_haystack, size_t old_haystack_len, const char *old_needle, size_t old_needle_len, zend_long offset, const mbfl_encoding *encoding); MBSTRING_API int php_mb_check_encoding(const char *input, size_t length, const mbfl_encoding *encoding); diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 06f65f5c567..1cedee5d79e 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -721,7 +721,7 @@ static inline void mb_regex_substitute( eos = replace + replace_len; while (p < eos) { - clen = (int) php_mb_mbchar_bytes_ex(p, enc); + clen = (int) php_mb_mbchar_bytes(p, enc); if (clen != 1 || p == eos || p[0] != '\\') { /* skip anything that's not an ascii backslash */ smart_str_appendl(pbuf, p, clen); @@ -729,7 +729,7 @@ static inline void mb_regex_substitute( continue; } sp = p; /* save position */ - clen = (int) php_mb_mbchar_bytes_ex(++p, enc); + clen = (int) php_mb_mbchar_bytes(++p, enc); if (clen != 1 || p == eos) { /* skip backslash followed by multibyte char */ smart_str_appendl(pbuf, sp, p - sp); @@ -759,7 +759,7 @@ static inline void mb_regex_substitute( break; case 'k': { - clen = (int) php_mb_mbchar_bytes_ex(++p, enc); + clen = (int) php_mb_mbchar_bytes(++p, enc); if (clen != 1 || p == eos || (p[0] != '<' && p[0] != '\'')) { /* not a backref delimiter */ p += clen; @@ -772,7 +772,7 @@ static inline void mb_regex_substitute( char maybe_num = 1; name_end = name = p + 1; while (name_end < eos) { - clen = (int) php_mb_mbchar_bytes_ex(name_end, enc); + clen = (int) php_mb_mbchar_bytes(name_end, enc); if (clen != 1) { name_end += clen; maybe_num = 0;