History log of /PHP-8.2/ext/mbstring/php_mbregex.c (Results 1 – 25 of 228)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 4df3dd76 08-Jul-2022 Arnaud Le Blanc

Reduce memory allocated by var_export, json_encode, serialize, and other (#8902)

smart_str uses an over-allocated string to optimize for append operations. Functions that use smart_str tend

Reduce memory allocated by var_export, json_encode, serialize, and other (#8902)

smart_str uses an over-allocated string to optimize for append operations. Functions that use smart_str tend to return the over-allocated string directly. This results in unnecessary memory usage, especially for small strings.

The overhead can be up to 231 bytes for strings smaller than that, and 4095 for other strings. This can be avoided for strings smaller than `4096 - zend_string header size - 1` by reallocating the string.

This change introduces `smart_str_trim_to_size()`, and calls it in `smart_str_extract()`. Functions that use `smart_str` are updated to use `smart_str_extract()`.

Fixes GH-8896

show more ...


# 56137cd2 23-Jun-2022 Máté Kocsis

Declare ext/mbstring constants in stubs (#8798)


# d3f56e5a 18-Oct-2020 Alex Dowad

Rename php_mb_mbchar_bytes_ex to php_mb_mbchar_bytes

...And remove the original php_mb_mbchar_bytes, which was not being
used.


# 01b3fc03 06-May-2021 KsaR

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |

show more ...


# 422d1665 14-Jan-2021 Nikita Popov

Make convert_to_*_ex simple aliases of convert_to_*

Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
sin

Make convert_to_*_ex simple aliases of convert_to_*

Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
since PHP 7.

The only difference that was still left is that _ex checked whether
the type is the same first, but the usage of these macros did not
actually distinguish on whether such an inlined check is valuable
or not in a given context.

Also drop the unused convert_to_explicit_type macros.

show more ...


# 5582490b 13-Oct-2020 Nikita Popov

Normalize mb_ereg() return value

mb_ereg()/mb_eregi() currently have an inconsistent return value
based on whether the $matches parameter is passed or not:

> Returns the byte le

Normalize mb_ereg() return value

mb_ereg()/mb_eregi() currently have an inconsistent return value
based on whether the $matches parameter is passed or not:

> Returns the byte length of the matched string if a match for
> pattern was found in string, or FALSE if no matches were found
> or an error occurred.
>
> If the optional parameter regs was not passed or the length of
> the matched string is 0, this function returns 1.

Coupling this behavior to the $matches parameter doesn't make sense
-- we know the match length either way, there is no technical
reason to distinguish them. However, returning the match length
is not particularly useful either, especially due to the need to
convert 0-length into 1-length to satisfy "truthy" checks. We
could always return 1, which would kind of match the behavior of
preg_match() -- however, preg_match() actually returns the number
of matches, which is 0 or 1 for preg_match(), while false signals
an error. However, mb_ereg() returns false both for no match and
for an error. This would result in an odd 1|false return value.

The patch canonicalizes mb_ereg() to always return a boolean,
where true indicates a match and false indicates no match or error.
This also matches the behavior of the mb_ereg_match() and
mb_ereg_search() functions.

This fixes the default value integrity violation in PHP 8.

Closes GH-6331.

show more ...


# 04441585 02-Apr-2020 George Peter Banyard

Promote some warnings in MBString Regexes

Closes GH-5341


# 62317d59 04-Jul-2020 Alex Dowad

Remove redundant includes from mbstring (and make sure correct config.h is used)

Very interesting... it turns out that when Valgrind support was enabled,
`#include "config.h"` from withi

Remove redundant includes from mbstring (and make sure correct config.h is used)

Very interesting... it turns out that when Valgrind support was enabled,
`#include "config.h"` from within mbstring was actually including the file "config.h"
from Valgrind, and not the one from mbstring!!

This is because -I/usr/include/valgrind was added to the compiler invocation _before_
-Iext/mbstring/libmbfl.

Make sure we actually include the file which was intended.

show more ...


# a64241b5 27-Jun-2020 Alex Dowad

Remove unused functions from mbstring

- mbfl_buffer_converter_reset
- mbfl_buffer_converter_strncat
- mbfl_buffer_converter_getbuffer
- mbfl_oddlen
- mbfl_filter_output_pipe_

Remove unused functions from mbstring

- mbfl_buffer_converter_reset
- mbfl_buffer_converter_strncat
- mbfl_buffer_converter_getbuffer
- mbfl_oddlen
- mbfl_filter_output_pipe_flush
- mbfl_memory_device_output2
- mbfl_memory_device_output4
- mbfl_is_support_encoding
- mbfl_buffer_converter_feed2
- _php_mb_regex_globals_dtor
- mime_header_encoder_feed
- mime_header_decoder_feed
- mbfl_convert_filter_feed

show more ...


# ac0da090 18-May-2020 Máté Kocsis

Fix UNKNOWN default values in ext/mbstring and ext/gd

Closes GH-5598


# 2b5de6f8 01-Jul-2020 Max Semenik

Remove proto comments from C files

Closes GH-5758


# 3516a9c8 30-Jun-2020 Christoph M. Becker

Replace ISO_8859-* with ISO8859-* aliases for MBString

We also remove the mbregex ISO 8859 aliases with underscores.


# 3f2f36d5 16-Jun-2020 Nikita Popov

Fix non-default syntax in mb_ereg_search()


# 68164f40 12-May-2020 George Peter Banyard

Fix [-Wundef] warning in MBString extension


# 2a4c81f1 14-Apr-2020 George Peter Banyard

Fix [-Wjump-misses-init] in php_mbregex.c by adding an inner scope


# 3eba187b 10-Apr-2020 George Peter Banyard

Refactor and remove dead code in mb_ereg(i)_replace

We do not support the 'e' option anymore.
Merged together code which would emit an error if this option is present.
This also make

Refactor and remove dead code in mb_ereg(i)_replace

We do not support the 'e' option anymore.
Merged together code which would emit an error if this option is present.
This also makes it clearer that the whole branch in the replacement section supporting this option is never hit, thus removed.

show more ...


# 73455778 06-Apr-2020 George Peter Banyard

Cache MBFL encoding for Oniguruma regex functions.

Closes GH-5355


# 577de174 02-Apr-2020 George Peter Banyard

Use ZEND_NUM_ARGS() macro instead of custom variable

Also why on earth would someone do this?


# 11f0e1d1 31-Mar-2020 Nikita Popov

Move encoding fetching out of php_mb_convert_encoding()


# daf45f68 31-Mar-2020 George Peter Banyard

Use explicit helper


# affc5a02 31-Mar-2020 George Peter Banyard

Encoding argument is always MBREX(current_mbctype)


# 90eeca25 28-Mar-2020 George Peter Banyard

Convert some unknown encoding warnings to ValueErrors in ext/mbstring

Promotes only the warnings where the encoding comes only from a string.
Functions which accept an array of encodings

Convert some unknown encoding warnings to ValueErrors in ext/mbstring

Promotes only the warnings where the encoding comes only from a string.
Functions which accept an array of encodings will be fixed at a later stage.

Closes GH-5317

show more ...


# 9e77d5a9 13-Mar-2020 Christoph M. Becker

Fix #76999: mb_regex_set_options() return current options

When setting new options, `mb_regex_set_options()` is supposed to
return the *previous* options.


# c7094d89 22-Feb-2020 George Peter Banyard

Fix mbstring regex variable types to correspond to Oniguruma

The beginning and ending of a Oniguruma Regex are stored in a OnigRegion (which is a typedef to the Oniguruma re_registers struct

Fix mbstring regex variable types to correspond to Oniguruma

The beginning and ending of a Oniguruma Regex are stored in a OnigRegion (which is a typedef to the Oniguruma re_registers struct) as as int* therefore change the type from size_t to int

Closes GH-5196

show more ...


# 560ff972 29-Jan-2020 Nikita Popov

Reset MBREX(search_re) in RSHUTDOWN

This is going to cause a segfault if reused in the next request.
To illustrate the issue, run these two scripts in sequence with
the built-in serv

Reset MBREX(search_re) in RSHUTDOWN

This is going to cause a segfault if reused in the next request.
To illustrate the issue, run these two scripts in sequence with
the built-in server:

// script1.php
mb_ereg_search_init('foobar');
mb_ereg_search('foo');

// script2.php
var_dump(mb_ereg_search_init("foobar"));
var_dump(mb_ereg_search_pos());

show more ...


12345678910