History log of /PHP-7.4/ext/standard/string.c (Results 1 – 25 of 1022)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 33f8dfb1 14-Jul-2021 Christoph M. Becker

Fix #72146: Integer overflow on substr_replace

Adding two `zend_long`s may overflow, and casting `size_t` to
`zend_long` may truncate; we can avoid this here by enforcing unsigned
ar

Fix #72146: Integer overflow on substr_replace

Adding two `zend_long`s may overflow, and casting `size_t` to
`zend_long` may truncate; we can avoid this here by enforcing unsigned
arithmetic.

Closes GH-7240.

show more ...


# 844a2dd6 18-Aug-2020 Christoph M. Becker

Fix #79986: str_ireplace bug with diacritics characters

`tolower()` returns an `int`, so we must not convert to `char` which
may be `signed` and as such may be subject to overflow (actua

Fix #79986: str_ireplace bug with diacritics characters

`tolower()` returns an `int`, so we must not convert to `char` which
may be `signed` and as such may be subject to overflow (actually,
implementation defined behavior).

Closes GH-6007

show more ...


# 9d9dffe6 11-Aug-2020 Nikita Popov

Fixed bug #79951

One branch did not release tmp_replace_entry_str.

Also reduce the scope of some variables.


# ce149b0c 13-Jul-2020 Evgeny Stepanischev

Fixed bug #79849

Closes GH-5853.


# a72c53a0 10-Jul-2020 Nikita Popov

Fixed bug #79817

Use *_IND macros in a few places in string.c.


# 372b678e 24-Jan-2020 Christoph M. Becker

Yet another check for php_strip_tags_ex()


# 6d57476f 24-Jan-2020 Christoph M. Becker

Yet another check for php_strip_tags_ex()


# 2dc170e2 23-Jan-2020 Stanislav Malyshev

More checks for php_strip_tags_ex


# 0f79b1bf 21-Jan-2020 Stanislav Malyshev

Fix #79099: OOB read in php_strip_tags_ex


Revision tags: php-7.3.13RC1, php-7.2.26RC1, php-7.4.0, php-7.2.25, php-7.3.12
# 600f1f89 17-Nov-2019 Christoph M. Becker

Fix #78814: strip_tags allows / in tag name => whitelist bypass

When normalizing tags to check whether they are contained in the set
of allowable tags, we must not strip slashes, unless

Fix #78814: strip_tags allows / in tag name => whitelist bypass

When normalizing tags to check whether they are contained in the set
of allowable tags, we must not strip slashes, unless they come
immediately after the opening `<`, or immediately before the closing
`>`.

show more ...


# fee38633 26-Nov-2019 Christoph M. Becker

Fix #78840: imploding $GLOBALS crashes

We add support for IS_INDIRECT zvals to implode().


Revision tags: 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, php-7.4.0RC3
# 6fcde56b 30-Sep-2019 Nikita Popov

Fixed bug #78612


Revision tags: php-7.2.23, php-7.3.10, php-7.4.0RC2, php-7.2.23RC1, php-7.3.10RC1, php-7.4.0RC1, php-7.1.32, php-7.2.22, php-7.3.9, php-7.4.0beta4, php-7.2.22RC1, php-7.3.9RC1, php-7.4.0beta2
# a87ef5e3 02-Aug-2019 Christoph M. Becker

Fix #78346: strip_tags no longer handling nested php tags

When the strip tags state machine has been flattened, an if statement
has mistakenly been treated as else if. We fix this, and

Fix #78346: strip_tags no longer handling nested php tags

When the strip tags state machine has been flattened, an if statement
has mistakenly been treated as else if. We fix this, and also simplify
a bit right away.

show more ...


Revision tags: php-7.1.31, php-7.2.21, php-7.3.8, php-7.4.0beta1, php-7.2.21RC1, php-7.3.8RC1
# 46b98240 12-Jul-2019 Nikita Popov

Deprecate implode() with swapped parameter order


# af763968 10-Jul-2019 Sebastian Pop

vectorize string-escape with NEON

On this benchmark:
function simple_string_escape() {
$a = "test'asd'asd'' asd\'\"asdfasdf";
for($i=0; $i<512; $i++) {
$a .=

vectorize string-escape with NEON

On this benchmark:
function simple_string_escape() {
$a = "test'asd'asd'' asd\'\"asdfasdf";
for($i=0; $i<512; $i++) {
$a .= chr($i%256);
}
for ($i = 0; $i < 100000; $i++) {
if ($a === stripslashes(addslashes($a)))
$a .= chr($i%256);
else {
echo "error at i=".$i."\n";
return;
}
}
}
the execution time goes from 21.619s to 8.139s (165% speedup) on an A1 Graviton instance.

When removing the characters that need escaping, i.e., this benchmark:
function simple_string() {
$a = "testasdasd asdasdfasdf";
for ($i = 0; $i < 10000; $i++) {
if ($a === stripslashes(addslashes($a)))
$a .= "test dedeasdf";
else {
echo "error at i=".$i."\n";
return;
}
}
}
the execution time goes from 2.932s down to 0.516s (468% speedup) on an A1 Graviton instance.

show more ...


Revision tags: php-7.4.0alpha3, php-7.3.7, php-7.2.20
# 88d52ae7 28-Jun-2019 Nikita Popov

Mark ifunc resolver functions as unused

It looks like clang doesn't see that these are used through
__attribute__((ifunc)) and generates a warning.


Revision tags: php-7.4.0alpha2
# 638c2176 23-Jun-2019 Peter Kokot

Remove HAVE_STRCOLL check

The strcoll function is defined in the C89 standard and should be
on today's systems always available via the <string.h> header.

https://port70.net/~ns

Remove HAVE_STRCOLL check

The strcoll function is defined in the C89 standard and should be
on today's systems always available via the <string.h> header.

https://port70.net/~nsz/c/c89/c89-draft.html#4.11.4.3

- Remove also SKIPIF strcoll check in test

show more ...


# d4de127d 20-Jun-2019 Nikita Popov

In php_needle_char() use well-defined double->integer cast

...by going through zval_get_long(). Generally out of range double
casts are undefined.


# e8ae1922 20-Jun-2019 Nikita Popov

Avoid address calculation overflow


Revision tags: php-7.3.7RC3, php-7.3.7RC2, php-7.2.20RC2, php-7.4.0alpha1, php-7.3.7RC1, php-7.2.20RC1, php-7.2.19, php-7.3.6, php-7.1.30, php-7.2.19RC1, php-7.3.6RC1, php-7.1.29
# f3ff72e5 30-Apr-2019 Christoph M. Becker

Fix #77937: preg_match failed

On some recent Windows systems, ext\pcre\tests\locales.phpt fails,
because 'pt_PT' is accepted by `setlocale()`, but not properly
supported by the ctype

Fix #77937: preg_match failed

On some recent Windows systems, ext\pcre\tests\locales.phpt fails,
because 'pt_PT' is accepted by `setlocale()`, but not properly
supported by the ctype functions, which are used internally by PCRE2 to
build the localized character tables.

Since there appears to be no way to properly check whether a given
locale is fully supported, but we want to minimize BC impact, we filter
out typical Unix locale names, except for a few cases which have
already been properly supported on Windows. This way code like

setlocale(LC_ALL, 'de_DE.UTF-8', 'de_DE', 'German_Germany.1252');

should work like on older Windows systems.

It should be noted that the locale names causing trouble are not (yet)
documented as valid names anyway, see
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-strings?view=vs-2019>.

show more ...


# 457392fa 05-Jun-2019 Dmitry Stogov

Cheaper checks for exceptions thrown from __toString()


Revision tags: php-7.2.18, php-7.3.5, php-7.2.18RC1, php-7.3.5RC1, php-7.2.17, php-7.3.4, php-7.1.28, php-7.3.4RC1, php-7.2.17RC1, php-7.1.27, php-7.3.3, php-7.2.16
# a31f4642 26-Feb-2019 Nikita Popov

Allow exceptions in __toString()

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

And convert some object to string conversion related recoverable
fatal errors into Error excep

Allow exceptions in __toString()

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

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.

show more ...


# 714d9fc3 08-May-2019 Gabriel Caruso

Make chr ZPP failure message consistent with ext/standard


# 69bab6e5 13-May-2019 Christoph M. Becker

Fix #78003: strip_tags output change since PHP 7.3

A refactoring of the strip tags state machine[1] missed the special
treatment of `depth > 0` when a `>` is encountered in state 2 or 3.

Fix #78003: strip_tags output change since PHP 7.3

A refactoring of the strip tags state machine[1] missed the special
treatment of `depth > 0` when a `>` is encountered in state 2 or 3. We
re-add it for BC reasons.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=5cf64742773ddbf9af69d962a4d12b567fcf0084>

show more ...


# 68a75782 03-May-2019 Sebastian Pop

[AArch64] use rev64 to reverse strings

The execution time goes from 4.388s down to 0.563s on a Graviton A1
instance for the benchmark:

function reverse_strings() {
$a =

[AArch64] use rev64 to reverse strings

The execution time goes from 4.388s down to 0.563s on a Graviton A1
instance for the benchmark:

function reverse_strings() {
$a = "foo";
for ($i = 0; $i < 100000; $i++) {
strrev($a);
$a .= "o";
}
}

show more ...


12345678910>>...41