1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Commit Graph

144652 Commits

Author SHA1 Message Date
Jordi Kroon
cdd5aa21d8 Fix dateformat_format_variant3 test and split into different files (#20901) 2026-01-12 05:07:02 +00:00
Niels Dossche
d8d754fc31 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20856: heap-use-after-free in SplDoublyLinkedList iterator when modifying during iteration
2026-01-11 20:43:19 +01:00
Niels Dossche
a82a93d64e Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20856: heap-use-after-free in SplDoublyLinkedList iterator when modifying during iteration
2026-01-11 20:43:12 +01:00
Niels Dossche
2a2e0e8128 Fix GH-20856: heap-use-after-free in SplDoublyLinkedList iterator when modifying during iteration
The element may be still in use in other places, so the linking pointers
should be kept consistent. If not consistent, the "move forward" code in
the sample test will read a stale, dangling pointer.

Closes GH-20885.
2026-01-11 20:42:25 +01:00
Niels Dossche
c434e046bc Remove LIBXML_XINCLUDE option from valid list of XMLDocument (#20907)
This option is only valid for pull parsers.
2026-01-11 20:38:03 +01:00
Niels Dossche
9b0643ea36 spl: Remove unused fields from spl dllist (#20886) 2026-01-11 15:08:31 +01:00
Ilija Tovilo
1ee38a3dcb Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix block_pass JMP[N]Z optimization
2026-01-11 14:56:11 +01:00
Ilija Tovilo
918dc2355e Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix block_pass JMP[N]Z optimization
2026-01-11 14:56:05 +01:00
Ilija Tovilo
f61b1fc036 Fix block_pass JMP[N]Z optimization
In the following optimization:

JMPZ(X,L1) JMP(L2) L1: -> JMPNZ(X,L2) NOP

L1 must not be followed by another block, so that it may safely be followed by
the block containing the JMPNZ. get_next_block() is used to verify L1 is the
direct follower. This function also skips empty blocks, including live, empty
target blocks, which will then implicitly follow the new follow block. This will
result in L1 being followed by two separate blocks, which is not possible.

Resolve this by get_next_block() stopping at target blocks.

Fixes OSS-Fuzz #472563272
Closes GH-20850
2026-01-11 14:55:23 +01:00
Niels Dossche
9ab800ec9b Mark Phar::buildFromIterator() base directory argument as a path
This is like buildFromDirectory() which does it right.

Closes GH-20892.
2026-01-11 12:27:36 +01:00
Ilija Tovilo
2813f62476 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix infinite loop in GC destructor fiber
2026-01-11 01:21:30 +01:00
Ilija Tovilo
99aec78209 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix infinite loop in GC destructor fiber
2026-01-11 01:21:22 +01:00
Ilija Tovilo
6f6c9e35e8 Fix infinite loop in GC destructor fiber
zend_object_release(&fiber->std) may restart the fiber due to finally. Any
thrown exception must be remembered and unset so that the next fiber may
successfully start.

Fixes OSS-Fuzz #471533782
Closes GH-20884
2026-01-11 01:20:32 +01:00
Niels Dossche
fb27990d3d Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20882: phar buildFromIterator breaks with missing base directory
2026-01-10 15:10:53 +01:00
Niels Dossche
b18b11ee28 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20882: phar buildFromIterator breaks with missing base directory
2026-01-10 15:10:08 +01:00
Niels Dossche
a6e0d8e359 Fix GH-20882: phar buildFromIterator breaks with missing base directory
Broke in f57526a07a because of changing a char*+size_t pair to
zend_string* (which can't handle NULL pointers in its macros).

Closes GH-20888.
2026-01-10 15:09:36 +01:00
Tim Düsterhus
265c0c632b Merge branch 'PHP-8.5'
* PHP-8.5:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:37 +01:00
Tim Düsterhus
1f3390283d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:27 +01:00
Tim Düsterhus
b5d6377ada output: Fail starting to output buffer when the output layer is deactivated (#20846)
Fixes php/php-src#20837.
2026-01-10 14:37:52 +01:00
Niels Dossche
c518a6ba8b Merge branch 'PHP-8.5'
* PHP-8.5:
  fastcgi: Fix compile warning wrt safe_read() (#20887)
2026-01-10 10:49:57 +01:00
Niels Dossche
750c220550 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  fastcgi: Fix compile warning wrt safe_read() (#20887)
2026-01-10 10:49:51 +01:00
Niels Dossche
60b1f59081 fastcgi: Fix compile warning wrt safe_read() (#20887)
This shouldn't be const. Fixes the following warning:
```
warning: variable 'hdr' is uninitialized when passed as a const pointer argument here
      [-Wuninitialized-const-pointer]
 1054 |         if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) ||
      |                             ^~~
```
2026-01-10 10:49:37 +01:00
Alex Dowad
79b52042e3 Use fast path in more cases when doing case folding with mb_convert_case
mbstring's Unicode case conversion is table-driven, using Minimal Perfect Hash tables.
However, for small codepoint values, we bypass the hashtable lookup and just use
hard-coded conversion logic (i.e. adding or subtracting 0x20 from the appropriate
ASCII range).

For upcasing and downcasing, we had already optimized the conditional which sends
execution down this fast path, to use the fast path for as many codepoint values
as possible. However, for case folding, this had not been done.

This will give a small performance boost for case-folding Unicode text which
includes non-breaking spaces, symbols like ¥ or ™, or accented Latin
characters (used in many European languages).
2026-01-10 13:10:59 +09:00
Jordi Kroon
51b1aa160d Fix GH-20858: null pointer dereference in php_mail_detect_multiple_crlf via error_log
close GH-20862
2026-01-10 00:51:25 +00:00
David Carlier
17915780db Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20840: crash on nested object with var_dump().
2026-01-09 18:15:05 +00:00
David Carlier
fb7a5712a6 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20840: crash on nested object with var_dump().
2026-01-09 18:14:05 +00:00
David Carlier
5d2456f974 Fix GH-20840: crash on nested object with var_dump().
mitigate it with stack check limit.

close GH-20843
2026-01-09 18:13:42 +00:00
Máté Kocsis
eea9a62b1b Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix constant references inside parameter default values when generating the manual
2026-01-08 22:52:32 +01:00
Máté Kocsis
eb1e22b1df Fix constant references inside parameter default values when generating the manual 2026-01-08 22:51:28 +01:00
Ilija Tovilo
ebef772cfd Merge branch 'PHP-8.5'
* PHP-8.5:
  [skip ci] Mark bug69442.phpt (PTY test) as flaky
2026-01-08 12:27:20 +01:00
Ilija Tovilo
a5c7903fbb Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [skip ci] Mark bug69442.phpt (PTY test) as flaky
2026-01-08 12:27:13 +01:00
Ilija Tovilo
226f68b24f Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Mark bug69442.phpt (PTY test) as flaky
2026-01-08 12:27:06 +01:00
Ilija Tovilo
33c3e30ed6 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Mark bug69442.phpt (PTY test) as flaky
2026-01-08 12:27:00 +01:00
Ilija Tovilo
4f25ea88f0 [skip ci] Mark bug69442.phpt (PTY test) as flaky
See GH-20864
2026-01-08 12:26:20 +01:00
Arnaud Le Blanc
ef522525cf Introduce zend_ast_call_get_args() (#20859) 2026-01-08 11:46:10 +01:00
Arnaud Le Blanc
92b2887722 Fix handling of ZEND_AST_CALLABLE_CONVERT in file cache (#20860)
Nodes in zend_ast_fcc->args were serialized, but not zend_ast_fcc->args itself
2026-01-07 18:54:29 +01:00
Frank Denis
643cf6253e Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/sodium: use correct constants and error messages (#20852)
2026-01-07 09:53:54 +01:00
Frank Denis
a04fa6c1f0 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/sodium: use correct constants and error messages (#20852)
2026-01-07 09:51:46 +01:00
Frank Denis
83f3d5d487 ext/sodium: use correct constants and error messages (#20852)
Fix copy-and-paste mistakes in the sodium extension.

crypto_scalarmult_BYTES and crypto_scalarmult_ristretto255_BYTES
have the same value, so behavior is unchanged.
2026-01-07 09:45:06 +01:00
Arnaud Le Blanc
5472cac806 Support PFA syntax
RFC: https://wiki.php.net/rfc/partial_function_application_v2

For FCCs, the parser generates a normal function call AST node, the but argument
list is a ZEND_AST_CALLABLE_CONVERT / zend_ast_fcc node.

We extend this for PFAs so that zend_ast_fcc can represent arguments.

 * Support PFA syntax in grammar
 * Update zend_ast_fcc so that arguments can be represented
 * Support serialization of zend_ast_fcc arguments in SHM / file cache
 * Introduce zend_ast_arg_list_add(): Same as zend_ast_list_add(), but wraps the
   list in a ZEND_AST_CALLABLE_CONVERT when adding any placeholder argument.

Technically the arg list wrapping is not required, but it results in simpler
code later as it will be very convenient in the compiler (determines whether a
function calls is a PFA/FCC), and for PFA-in-const-expr support. It also allows
to unify FCCs and PFAs in the grammar.

Closes GH-20717.
2026-01-06 12:01:48 +01:00
Niels Dossche
e4098da58a Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20833: mb_str_pad() divide by zero if padding string is invalid in the encoding
2026-01-05 20:01:59 +01:00
Niels Dossche
171b52c98f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20833: mb_str_pad() divide by zero if padding string is invalid in the encoding
2026-01-05 20:01:54 +01:00
Niels Dossche
03113b09ce Fix GH-20833: mb_str_pad() divide by zero if padding string is invalid in the encoding
If the padding string is not valid in the given encoding,
mb_get_strlen() can return 0.

Closes GH-20834.
2026-01-05 20:01:25 +01:00
Remi Collet
988d29b4db Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix missing liburiparser linker option
2026-01-05 08:19:22 +01:00
Remi Collet
9b089edcbd Fix missing liburiparser linker option 2026-01-05 08:19:07 +01:00
Jordi Kroon
cb63e4f998 [skip ci] Remove obsolete comment (GH-20826) 2026-01-04 01:27:40 +01:00
Ilija Tovilo
9c4b29b236 Merge branch 'PHP-8.5'
* PHP-8.5:
  Remove duplicate no/yes print for preserve_none
2026-01-04 01:24:45 +01:00
henderkes
7b70ee5a9d Remove duplicate no/yes print for preserve_none
Closes GH-20827
2026-01-04 01:24:35 +01:00
Giovanni Giacobbi
fd0ed00ff3 curl: Deduplicate features array 2026-01-03 18:49:23 +00:00
Giovanni Giacobbi
50af7c7373 curl: Fix coding style 2026-01-03 18:49:23 +00:00