History log of /PHP-8.0/ext/pcre/php_pcre.c (Results 1 – 25 of 546)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 712fc54e 29-Nov-2021 Christoph M. Becker

Fix #74604: Out of bounds in php_pcre_replace_impl

Trying to allocate a `zend_string` with a length only slighty smaller
than `SIZE_MAX` causes an integer overflow; we make sure that thi

Fix #74604: Out of bounds in php_pcre_replace_impl

Trying to allocate a `zend_string` with a length only slighty smaller
than `SIZE_MAX` causes an integer overflow; we make sure that this
doesn't happen by catering to the maximal overhead of a `zend_string`.

Closes GH-7597.

show more ...


# bc6ec0a1 18-Nov-2021 Nikita Popov

Clarify that preg_match_all() cannot return null


# 56495ac0 21-Oct-2021 Remi Collet

fix for pcre2 10.38


# a6f5c2dc 21-Oct-2021 Remi Collet

fix for pcre2 10.38


# a6b43086 12-Jul-2021 Christoph M. Becker

Fix #81243: Too much memory is allocated for preg_replace()

Trimming a potentially over-allocated string appears to be reasonable,
so we drop the condition altogether.

We also r

Fix #81243: Too much memory is allocated for preg_replace()

Trimming a potentially over-allocated string appears to be reasonable,
so we drop the condition altogether.

We also re-allocate twice the size needed in the first place, and not
roughly tripple the size.

Closes GH-7231.

show more ...


# f7ab7951 06-Jun-2021 Anatol Belski

pcre: Workaround bug #81101

The way to fix it is to disable certain match start optimizaions. The
observed performance impact appears negligible ATM, compared to the
functional regre

pcre: Workaround bug #81101

The way to fix it is to disable certain match start optimizaions. The
observed performance impact appears negligible ATM, compared to the
functional regression revealed.

A possible side effect might occur if a pattern uses (*COMMIT) or
(*MARK), which is however not a very broadly used syntax in PHP. Still
this should be observed and handled by possibly adding a possibility to
reverse PCRE2_NO_START_OPTIMIZE on the user side.

One test shows a behavior change, where instead of int 0 the match
would produce an error and return false. Except strict comparison
is used, this should be acceptable.

Signed-off-by: Anatol Belski <ab@php.net>
(cherry picked from commit d188ca7688315e3d32d41a32e0ce7b1f9bffb4cf)
Signed-off-by: Anatol Belski <ab@php.net>

show more ...


# 4be867e9 18-Mar-2021 Nikita Popov

Fix locale switch back to C in pcre

The compile context is shared between patterns, so we need to set
the character tables unconditionally in case we switched from
a non-C locale to

Fix locale switch back to C in pcre

The compile context is shared between patterns, so we need to set
the character tables unconditionally in case we switched from
a non-C locale to the C locale.

show more ...


# 282355ef 15-Mar-2021 Dharman

Fix bug #80866

Closes GH-6774.


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
# 41b8cdd2 22-Oct-2020 Nikita Popov

Don't leak pcre error_code across requests


Revision tags: php-8.0.0RC2, php-7.4.12RC1, php-7.3.24RC1
# 6b00196e 01-Oct-2020 Máté Kocsis

Review parameter names in ext/pcre

Closes GH-6259


Revision tags: php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23, php-8.0.0beta4
# d81ea5e9 15-Sep-2020 Nikita Popov

Fix preg_replace_callback_array() with array subject

Apparently this "feature" was completely untested...


Revision tags: php-7.4.11RC1, php-7.3.23RC1
# c98d4769 10-Sep-2020 Máté Kocsis

Consolidate new union type ZPP macro names

They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.

Closes GH-6112


# f4b2497a 07-Sep-2020 Nikita Popov

Allocate temporary PCRE match data using ZMM

Create a separate general context that uses ZMM as allocator and
use it to allocate temporary PCRE match data (there is still one
global

Allocate temporary PCRE match data using ZMM

Create a separate general context that uses ZMM as allocator and
use it to allocate temporary PCRE match data (there is still one
global match data). There is no requirement that the match data
and the compiled regex / match context use the same general context.

This makes sure that we do not leak persistent memory on bailout
and fixes oss-fuzz #25296, on which half the libfuzzer runs
currently get stuck.

show more ...


Revision tags: php-8.0.0beta3, php-7.4.10, php-7.3.22
# ea87d048 25-Aug-2020 Máté Kocsis

Promote warnings to exceptions in ext/pcre

Closes GH-6006


Revision tags: 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
# d92229d8 06-Apr-2020 Nikita Popov

Implement named parameters

From an engine perspective, named parameters mainly add three
concepts:

* The SEND_* opcodes now accept a CONST op2, which is the
argument nam

Implement named parameters

From an engine perspective, named parameters mainly add three
concepts:

* The SEND_* opcodes now accept a CONST op2, which is the
argument name. For now, it is looked up by linear scan and
runtime cached.
* This may leave UNDEF arguments on the stack. To avoid having
to deal with them in other places, a CHECK_UNDEF_ARGS opcode
is used to either replace them with defaults, or error.
* For variadic functions, EX(extra_named_params) are collected
and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS.

RFC: https://wiki.php.net/rfc/named_params

Closes GH-5357.

show more ...


# af1de148 22-Jun-2020 George Peter Banyard

Use ZPP string|array union check in PCRE extension


# 302933da 07-Jul-2020 Nikita Popov

Remove no_separation flag


# 632766a5 07-Jul-2020 Nikita Popov

Disallow separation in a number of callbacks

All of these clearly do not need separation support.


# 2b5de6f8 01-Jul-2020 Max Semenik

Remove proto comments from C files

Closes GH-5758


# 1a2732f9 22-Jun-2020 George Peter Banyard

Use ZPP callable check for preg_replace_callback() $callback argument


# 83a77015 08-Jun-2020 twosee

Add helper APIs for maybe-interned string creation

Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using
ZVAL_INTERNED_STRING and ZSTR_CHAR.

Add zend_string_init_fast()

Add helper APIs for maybe-interned string creation

Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using
ZVAL_INTERNED_STRING and ZSTR_CHAR.

Add zend_string_init_fast() as a helper for the empty string /
one char interned string / zend_string_init() pattern.

Also add corresponding ZVAL_STRINGL_FAST etc macros.

Closes GH-5684.

show more ...


# 88355dd3 07-Jun-2020 twosee

Constify char * arguments of APIs

Closes GH-5676.


# 2414b3d7 07-May-2020 Nikita Popov

Ensure ctype_string is NULL for C locale

We already document that this is the case, but currently it's only
true if setlocale() has not been called. Make sure ctype_string is
always

Ensure ctype_string is NULL for C locale

We already document that this is the case, but currently it's only
true if setlocale() has not been called. Make sure ctype_string is
always NULL, even with an explicit "C" locale call, so we can
more efficiently check whether we are in the "C" locale.

Closes GH-5542.

show more ...


# 3f769473 07-May-2020 Nikita Popov

Rename locale_string to ctype_string

To make it more obvious that this only refers to the LC_CTYPE
locale.


# 4fb705a0 14-Apr-2020 Nikita Popov

Add zend_string_concat2 API


12345678910>>...22