1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 16:38:25 +02:00
Commit Graph

60312 Commits

Author SHA1 Message Date
Nikita Popov 934eb55d65 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix missing undef checks for comparisons
2021-09-21 12:09:30 +02:00
Nikita Popov 0ad2444513 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix missing undef checks for comparisons
2021-09-21 12:09:18 +02:00
Nikita Popov 95e0cc06a2 Fix missing undef checks for comparisons 2021-09-21 12:06:32 +02:00
Dmitry Stogov 5eb16a8d41 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT x86: Fixed incorrect EX(func) initialization for recursive calls
2021-09-21 13:02:52 +03:00
Dmitry Stogov c9f348805f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT x86: Fixed incorrect EX(func) initialization for recursive calls
2021-09-21 13:02:31 +03:00
Dmitry Stogov 0e0f50b413 JIT x86: Fixed incorrect EX(func) initialization for recursive calls 2021-09-21 13:01:27 +03:00
Dmitry Stogov 0d51165c7c Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT x86: Fixed register clobbering in code produced for "$x[$y] %= $z".
2021-09-21 10:49:11 +03:00
Dmitry Stogov 443b196033 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT x86: Fixed register clobbering in code produced for "$x[$y] %= $z".
  Fix #81420: ZipArchive::extractTo extracts outside of destination
2021-09-21 10:48:59 +03:00
Dmitry Stogov f0f774a129 JIT x86: Fixed register clobbering in code produced for "$x[$y] %= $z". 2021-09-21 10:42:53 +03:00
Stanislav Malyshev cf7c901970 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81420: ZipArchive::extractTo extracts outside of destination
2021-09-20 21:35:58 -07:00
Stanislav Malyshev cebff25d27 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81420: ZipArchive::extractTo extracts outside of destination
2021-09-20 21:35:43 -07:00
Stanislav Malyshev f92bae23ce Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #81420: ZipArchive::extractTo extracts outside of destination
2021-09-20 21:34:57 -07:00
Christoph M. Becker df2ceac25a Fix #81420: ZipArchive::extractTo extracts outside of destination
We need to properly detect and handle absolute paths in a portable way.
2021-09-20 21:29:24 -07:00
George Peter Banyard 3e57f15447 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix Bug #81462 mime_content_type() indicates wrong arg num on TypeError
2021-09-20 22:49:04 +01:00
George Peter Banyard 16c98d481f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix Bug #81462 mime_content_type() indicates wrong arg num on TypeError
2021-09-20 22:48:46 +01:00
George Peter Banyard 0ea38b9509 Fix Bug #81462 mime_content_type() indicates wrong arg num on TypeError 2021-09-20 22:48:00 +01:00
Dmitry Stogov 3fd322be37 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Move unusual checks for IS_REFERENCE to cold paths.
2021-09-20 21:15:31 +03:00
Dmitry Stogov ac1dd73048 JIT: Move unusual checks for IS_REFERENCE to cold paths. 2021-09-20 21:14:26 +03:00
Christoph M. Becker 81b501f1ac Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #61700: FILTER_FLAG_IPV6/FILTER_FLAG_NO_PRIV|RES_RANGE failing
2021-09-20 17:46:28 +02:00
Christoph M. Becker 1dcc0ff5f6 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #61700: FILTER_FLAG_IPV6/FILTER_FLAG_NO_PRIV|RES_RANGE failing
2021-09-20 17:45:34 +02:00
Christoph M. Becker fbc922d55c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #61700: FILTER_FLAG_IPV6/FILTER_FLAG_NO_PRIV|RES_RANGE failing
2021-09-20 17:39:22 +02:00
Christoph M. Becker 288c25f7d1 Fix #61700: FILTER_FLAG_IPV6/FILTER_FLAG_NO_PRIV|RES_RANGE failing
It makes no sense to compare IPv6 address ranges as strings; there are
too many different representation possibilities.  Instead, we change
`_php_filter_validate_ipv6()` so that it can calculate the IP address
as integer array.  We do not rely on `inet_pton()` which may not be
available everywhere, at least IPv6 support may not, but rather parse
the IP address manually.  Finally, we compare the integers.

Note that this patch does not fix what we consider as reserved and
private, respectively, but merely tries to keep what we had so far.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-7476.
2021-09-20 17:38:05 +02:00
Nikita Popov a22f9fc104 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed bug #81457
2021-09-20 15:29:40 +02:00
Nikita Popov ea11e79a43 Fixed bug #81457
When Reflection internally instantiates a ReflectionClass, it
should create a more specific ReflectionEnum instance if the
class is actually an enum.
2021-09-20 15:29:30 +02:00
George Peter Banyard 3240a74762 Use more specific return type for stream functions
Some void, some zend_result, some bool
2021-09-20 14:24:59 +01:00
Nikita Popov 32f6c616ae Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't replace values in unreachable code in sccp
2021-09-20 13:13:43 +02:00
Nikita Popov 55582a2527 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Don't replace values in unreachable code in sccp
2021-09-20 13:12:43 +02:00
Nikita Popov 1b33da5dd2 Don't replace values in unreachable code in sccp
While technically legal, this may cause unexpected situations
(in this example, setting an FE_FREE operand to constant null)
and is suboptimal anyway. It's better to preserve the vacuous type
and drop it later (though we currently don't implement this).
2021-09-20 13:12:26 +02:00
Alex Dowad 4e51810f9b Optimize mbstring upper/lowercasing: use fast path in more cases
The 'fast path' in the uppercase/lowercase functions for Unicode text can be used
for a slightly greater range of characters. This is not expected to have a big
impact on performance, since the number of characters which will use the 'fast path'
is only increased by about 50-60, and these are not very commonly used characters...
but still, it doesn't cost anything.
2021-09-20 11:27:54 +02:00
Alex Dowad 36c979e2b6 Use stack-allocated buffer in php_mb_chr 2021-09-20 11:27:54 +02:00
Alex Dowad 07c4b3b8c0 Simplify code for handling mbstring language aliases
Rather than using pointers to pointers to pointers (3 levels of indirection), what
makes sense is two levels. This reduces unnecessary pointer dereference operations.
2021-09-20 11:27:54 +02:00
Alex Dowad 2f096c4039 Remove useless constant MBFL_ENCTYPE_MWC2 2021-09-20 11:27:54 +02:00
Alex Dowad 1170981b33 Fix mb_str_split on empty strings in variable-length text encodings
Previously, when passed an empty string, and given an encoding which
uses a variable number of bytes per character (and which doesn't have
a 'character length table'), mb_str_split would return an array
containing a single empty string, rather than an empty array.

The ISO-2022 encodings are among those which were affected by this bug.
2021-09-20 11:27:54 +02:00
Alex Dowad 57eafd44c6 Add more tests for mb_decode_numericentity 2021-09-20 11:27:54 +02:00
Alex Dowad be11d95170 Add more tests for mb_encode_numericentity 2021-09-20 11:27:54 +02:00
Alex Dowad 68176fdfb1 Use char literals in HTML numeric entity {en,de}coding functions 2021-09-20 11:27:54 +02:00
Alex Dowad 1c905434b9 Add more tests for mb_substr 2021-09-20 11:27:54 +02:00
Alex Dowad f663344f33 Merge branch 'PHP-8.1'
* PHP-8.1:
  Bug #81390: mb_detect_encoding should not prematurely stop processing input
  mb_detect_encoding with only one candidate encoding uses mb_check_encoding
  Optimize text encoding detection for speed (eliminate Unicode property lookups)
2021-09-20 11:27:07 +02:00
Alex Dowad c25a1ef8d0 Bug #81390: mb_detect_encoding should not prematurely stop processing input
As a performance optimization, mb_detect_encoding tries to stop
processing the input string early when there is only one 'candidate'
encoding which the input string is valid in. However, the code which
keeps count of how many candidate encodings have already been rejected
was buggy. This caused mb_detect_encoding to prematurely stop
processing the input when it should have continued.

As a result, it did not notice that in the test case provided by Alec,
the input string was not valid in UTF-16.
2021-09-20 11:21:39 +02:00
Alex Dowad ca33ab59ad mb_detect_encoding with only one candidate encoding uses mb_check_encoding
...Because it's about 5% faster.
2021-09-20 11:20:53 +02:00
Alex Dowad 6acd4f7f3a Optimize text encoding detection for speed (eliminate Unicode property lookups)
...By just testing the input codepoints if they are within a few fixed
ranges instead. This avoids hash lookups in property tables.

From (micro-)benchmarking on my PC, this looks to be a bit less than 4x
faster than the existing code.
2021-09-20 11:20:53 +02:00
Nikita Popov b0989f07af Merge branch 'PHP-8.1'
* PHP-8.1:
  Make setcookie() test more robust against the passage of time
2021-09-20 10:29:24 +02:00
Nikita Popov ad14d6506a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Make setcookie() test more robust against the passage of time
2021-09-20 10:29:13 +02:00
Nikita Popov b4d7387468 Make setcookie() test more robust against the passage of time 2021-09-20 10:28:45 +02:00
Christoph M. Becker e47af326da Don't disable unrelated ext during configure
This is apparently a long-standing copy & paste issue.
2021-09-20 10:26:33 +02:00
Nikita Popov bc19186c7f Merge branch 'PHP-8.1'
* PHP-8.1:
  Use ephemeral ports in socket test
2021-09-20 10:20:10 +02:00
Nikita Popov 624848f118 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Use ephemeral ports in socket test
2021-09-20 10:20:03 +02:00
Nikita Popov 07f6c61c8e Use ephemeral ports in socket test 2021-09-20 10:19:48 +02:00
Nikita Popov e740907ec9 Merge branch 'PHP-8.1'
* PHP-8.1:
  Update Unicode tables to 14.0.0
2021-09-20 09:58:32 +02:00
Colin O'Dell fe36b81d5e Update Unicode tables to 14.0.0
Closes GH-7502.
2021-09-20 09:58:20 +02:00