History log of /PHP-8.3/ext/mbstring/mbstring.c (Results 1 – 25 of 871)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# c34d4fbb 11-Oct-2024 David Carlier

Fix GH-16360 mb_substr overflow on start and length arguments.

occurs when they are negated to start working from the end instead
when set with ZEND_LONG_MIN.


# 5853cdb7 20-Aug-2024 Gina Peter Bnayard

Use "must not" instead of "cannot" wording


# 9a2fdbec 18-Aug-2024 Gina Peter Bnayard

ext/mbstring: Use standard wording for ValueError


# 25a51461 01-Jun-2024 Gina Peter Banyard

Clean-up unused headers (#14365)

* ext/mbstring.c: clean-up headers and include intrinsics


# 48d5ae98 29-May-2024 Gina Peter Banyard

ext/standard: Refactor exec.c public APIs to use zend_string pointers (#14353)

* Pull zend_string* from INI directive

* Ensure that mail.force_extra_parameters INI directive does no

ext/standard: Refactor exec.c public APIs to use zend_string pointers (#14353)

* Pull zend_string* from INI directive

* Ensure that mail.force_extra_parameters INI directive does not have any nul bytes

* ext/standard: Make php_escape_shell_cmd() take a zend_string* instead of char*

This saves on an expensive strlen() computation

* Convert E_ERROR to ValueError in php_escape_shell_cmd()

* ext/standard: Make php_escape_shell_arg() take a zend_string* instead of char*

This saves on an expensive strlen() computation

* Convert E_ERROR to ValueError in php_escape_shell_arg()

show more ...


# c96e8946 22-Nov-2023 Gina Peter Banyard

ext/mbstring: Check encoding passed to mb_http_output() has no null bytes


# 86dfbadc 19-Nov-2023 Gina Peter Banyard

ext/mbstring: Always pass length to php_mb_get_encoding_or_pass()

We have access to this information, so propagate it instead of calling strlen().
This also removes the newly introduced

ext/mbstring: Always pass length to php_mb_get_encoding_or_pass()

We have access to this information, so propagate it instead of calling strlen().
This also removes the newly introduced _ex() variant.

show more ...


# b61479bb 18-Nov-2023 Gina Peter Banyard

ext/mbstring: Pass string length to _php_mb_ini_mbstring_http_output_set()


# f8137084 24-Apr-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-13815: mb_trim() inaccurate $characters default value (#13820)

Because the default characters are defined in the stub file, and the
stub file is UTF-8 (typically), the characters

Fix GH-13815: mb_trim() inaccurate $characters default value (#13820)

Because the default characters are defined in the stub file, and the
stub file is UTF-8 (typically), the characters are encoded in the string
as UTF-8. When using a different character encoding, there is a mismatch
between what mb_trim expects and the UTF-8 encoded string it gets.

One way of solving this is by making the characters argument nullable,
which would mean that it always uses the internal code path that has the
unicode codepoints that are defaulted actually stored as codepoint
numbers instead of in a string.

Co-authored-by: @ranvis

show more ...


# 4d51bfa2 20-Mar-2024 tekimen

[RFC] Add mb_ucfirst and mb_lcfirst functions (#13161)


# 8128d17c 24-Jan-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix build warning in ext/mbstring


# 927adfb1 20-Dec-2023 Cristian Rodríguez

Use a single version of mempcpy(3) (#12257)

While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_memp

Use a single version of mempcpy(3) (#12257)

While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_mempcpy, adds zend_mempcpy and transforms
open-coded parts into function calls.

show more ...


# cffdeb81 14-Dec-2023 Alex Dowad

Add specialized implementation of mb_strcut for GB18030

For GB18030, it is not generally possible to identify character
boundaries without scanning through the entire string. Therefore,

Add specialized implementation of mb_strcut for GB18030

For GB18030, it is not generally possible to identify character
boundaries without scanning through the entire string. Therefore,
implement mb_strcut using a similar strategy as the mblen_table based
implementation in mbstring.c. The difference is that for GB18030, we
need to look at two leading bytes to determine the byte length of a
multi-byte character.

The new implementation is 4-5x faster for short strings, and more than
10x faster for long strings. (Part of the reason why this new code has
such a great performance advantage is because it is replacing code
based on the older text conversion filters provided by libmbfl, which
were quite slow.)

The behavior is the same as before for valid GB18030 strings; for
some invalid strings, mb_strcut will choose different 'cut' points
as compared to before. (Clang's libFuzzer was used to compare the
old and new implementations, searching for test cases where they had
different behavior; no such cases were found.)

show more ...


# 6da8b93e 22-Nov-2023 Gina Peter Banyard

ext/mbstring: Refactor mb_get_info()


# a6775c30 22-Nov-2023 Gina Peter Banyard

ext/mbstring: Refactor mb_trim_width() to take size_t arguments


# 88ba9dc6 07-Dec-2023 Gina Peter Banyard

ext/mbstring: Always throw ValueErrors for invalid mb_http_input() type


# e74bf42c 06-Dec-2023 Gina Peter Banyard

ext/mbstring: Check conversion map only has integers


# 193b22fa 06-Dec-2023 Gina Peter Banyard

ext/mbstring: pass true conversion map size around


# a2ea4521 05-Dec-2023 Alex Dowad

Return early from mb_get_substr if 'len' parameter is zero

This internal function is used to implement mb_strstr, mb_stristr,
mb_strrchr, mb_strrichr, mb_substr, mb_strimwidth, mb_trim,

Return early from mb_get_substr if 'len' parameter is zero

This internal function is used to implement mb_strstr, mb_stristr,
mb_strrchr, mb_strrichr, mb_substr, mb_strimwidth, mb_trim, and
mb_str_pad. All of these functions will be faster if we return
early when requested for a zero-length "substring".

show more ...


# 56077b03 04-Dec-2023 Alex Dowad

Return early from mb_strcut if 'len' parameter is zero


# 8d98f720 05-Dec-2023 Michael Voříšek

Use ZSTR_IS_VALID_UTF8 macro where possible (#12869)


# b532b9a2 18-Nov-2023 Gina Peter Banyard

ext/mbstring: use unsigned char for variable with max value of 255


# 840d800d 18-Nov-2023 Gina Peter Banyard

ext/mbstring: Move variable declaration to inner scope


# ce82c48c 18-Nov-2023 Gina Peter Banyard

ext/mbstring: Use bool where more appropriate instead of int


# 3f64a7c0 18-Nov-2023 Gina Peter Banyard

ext/mbstring: Use unsigned int where more appropriate instead of int


12345678910>>...35