History log of /PHP-8.0/ext/mbstring/php_mbregex.c (Results 1 – 25 of 223)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: php-8.0.0, php-7.3.25, php-7.4.13, php-8.0.0RC5, php-7.4.13RC1, php-8.0.0RC4, php-7.3.25RC1, php-7.4.12, php-8.0.0RC3, php-7.3.24, php-8.0.0RC2
# 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 ...


Revision tags: php-7.4.12RC1, php-7.3.24RC1, php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23, php-8.0.0beta4, php-7.4.11RC1, php-7.3.23RC1, php-8.0.0beta3, php-7.4.10, php-7.3.22, php-8.0.0beta2, php-7.3.22RC1, php-7.4.10RC1, php-8.0.0beta1, php-7.4.9, php-7.2.33, php-7.3.21, php-8.0.0alpha3, php-7.4.9RC1, php-7.3.21RC1, php-7.4.8, php-7.2.32, php-8.0.0alpha2, php-7.3.20, php-8.0.0alpha1, php-7.4.8RC1, php-7.3.20RC1, php-7.4.7, php-7.3.19, php-7.4.7RC1, php-7.3.19RC1, php-7.4.6, php-7.2.31, php-7.4.6RC1, php-7.3.18RC1, php-7.2.30, php-7.4.5, php-7.3.17
# 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)


Revision tags: php-7.4.5RC1, php-7.3.17RC1
# 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 ...


Revision tags: php-7.3.18, php-7.4.4, php-7.2.29, php-7.3.16
# 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.


Revision tags: php-7.4.4RC1, php-7.3.16RC1
# 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 ...


Revision tags: php-7.4.3, php-7.2.28, php-7.3.15RC1, php-7.4.3RC1
# 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 ...


# 392ad206 29-Jan-2020 Nikita Popov

Fix use of mb_ereg_search_getregs() after invalid pattern

This segfaulted because we assumed that if there are matches,
there must be a regular expression as well.


Revision tags: php-7.3.15, php-7.2.27, php-7.4.2, php-7.3.14
# d1764ca3 15-Jan-2020 Máté Kocsis

Make error messages more consistent by fixing capitalization

Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.


Revision tags: php-7.3.14RC1, php-7.4.2RC1
# aadd3aae 03-Jan-2020 Máté Kocsis

Use RETURN_THROWS() in various places


# 34570372 31-Dec-2019 Máté Kocsis

Use RETURN_THROWS() during ZPP in most of the extensions

Except for some bigger ones: reflection, sodium, spl


Revision tags: php-7.4.1, php-7.2.26, php-7.3.13, php-7.4.1RC1, php-7.3.13RC1, php-7.2.26RC1, php-7.4.0, php-7.2.25, php-7.3.12, php-7.4.0RC6, php-7.3.12RC1, php-7.2.25RC1, php-7.4.0RC5, php-7.1.33, php-7.2.24, php-7.3.11, php-7.4.0RC4, php-7.3.11RC1, php-7.2.24RC1
# 058fed6c 06-Oct-2019 Christoph M. Becker

Just return on failing ZPP


123456789