75697 Commits
Author SHA1 Message Date
Weilin Du 7141eefc25 Merge branch 'PHP-8.6'
* PHP-8.6:
  Merge branch 'PHP-8.5' into PHP-8.6
2026-10-29 01:14:25 +08:00
Weilin Du 3b8acb3290 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Merge branch 'PHP-8.4' into PHP-8.5
2026-10-29 01:14:08 +08:00
Weilin Du 0544c34e21 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-24784: Preserve certificates when reading PKCS7/CMS CRLs (#24785)
2026-10-29 01:13:21 +08:00
Alexander Danilov 3ace942115 Fix GH-24784: Preserve certificates when reading PKCS7/CMS CRLs (#24785)
The certificate and CRL loops in openssl_pkcs7_read() and
openssl_cms_read() both indexed the output array with their own counter,
so each CRL replaced the certificate at the same index. Append with
add_next_index_zval() instead, preserving both certificates and CRLs.

Closes #24785
2026-10-29 01:11:47 +08:00
Arnaud Le Blanc 94c2ad2f3b Merge branch 'PHP-8.6'
* PHP-8.6:
  JIT: fix vm_interrupt resumption in TAILCALL/CALL VMs (#24793)
2026-10-28 09:28:26 +01:00
Arnaud Le Blanc 37999c737a Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  JIT: fix vm_interrupt resumption in TAILCALL/CALL VMs (#24793)
2026-10-28 09:28:15 +01:00
Levi Morrison 8975c59b17 JIT: fix vm_interrupt resumption in TAILCALL/CALL VMs (#24793)
In the CALL and TAILCALL VMs, opcode handlers called by function JIT
can return the next opline tagged with ZEND_VM_ENTER_BIT after invoking
a VM interrupt callback. Function JIT used that result directly as an
opcode pointer, causing invalid accesses when execution continued.
2026-10-28 09:27:33 +01:00
Weilin Du c2907d2875 Merge branch 'PHP-8.6'
* PHP-8.6:
  Merge branch 'PHP-8.5' into PHP-8.6
  Fix IntlDateFormatter parse functions truncating an $offset below INT_MIN (#24781)
2026-10-28 16:11:38 +08:00
Weilin Du e427f87653 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Merge branch 'PHP-8.4' into PHP-8.5
  Fix IntlDateFormatter parse functions truncating an $offset below INT_MIN (#24781)
2026-10-28 16:10:58 +08:00
Weilin Du 32b16a07d6 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix IntlDateFormatter parse functions truncating an $offset below INT_MIN (#24781)
2026-10-28 16:08:58 +08:00
Marc Bennewitz a07ae61b36 Fix IntlDateFormatter parse functions truncating an $offset below INT_MIN (#24781)
Check both bounds before narrowing the parse offset to int32_t. On 64-bit
systems, a value such as -4294967295 previously became 1 and parsing
started at the wrong position. Cover all three parse functions with a
regression test.

Closes #24781
2026-10-28 16:07:15 +08:00
ndossche 8867746907 Merge branch 'PHP-8.6'
* PHP-8.6:
  Fix use-after-free in Randomizer::shuffleArray() when the engine throws
2026-10-28 08:25:23 +01:00
ndossche 30bcf4bd89 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Fix use-after-free in Randomizer::shuffleArray() when the engine throws
2026-10-28 08:25:17 +01:00
ndossche dbd6ed433d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix use-after-free in Randomizer::shuffleArray() when the engine throws
2026-10-28 08:24:57 +01:00
Martin Mirchev 3a8bcb6d18 Fix use-after-free in Randomizer::shuffleArray() when the engine throws
php_array_data_shuffle() first compacts the holes of a packed array and
only then updates nNumUsed. When the engine threw in between, the stale
tail slots were still counted, so the moved values were released twice
when the copied array was destroyed. Update nNumUsed right after the
compaction.

Closes GH-24553.
2026-10-28 08:24:25 +01:00
David Carlier 758c9ac549 Merge branch 'PHP-8.6'
* PHP-8.6:
  ext/dom: fix UAF on namespace axis results with foreign-doc XPath callback nodes
2026-10-28 03:15:23 +00:00
David Carlier 3299d94c80 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  ext/dom: fix UAF on namespace axis results with foreign-doc XPath callback nodes
2026-10-28 03:15:22 +00:00
David Carlier d657f7a3c7 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/dom: fix UAF on namespace axis results with foreign-doc XPath callback nodes

# Conflicts:
#	ext/dom/xpath.c
2026-10-28 03:15:21 +00:00
David Carlier 98b580b0d2 ext/dom: fix UAF on namespace axis results with foreign-doc XPath callback nodes
Follow-up to https://github.com/php/php-src/pull/24570#issuecomment-6375965729

The namespace node branch of php_xpath_eval() still created the parent
element with the DOMXPath's own dom, so with a foreign-doc callback node
the parent proxy referenced the wrong document. Use
dom_xpath_intern_for_doc() there too.

Close GH-24629
2026-10-28 03:14:25 +00:00
Jorg Sowa 780f4e8217 Merge branch 'PHP-8.6'
* PHP-8.6:
  Fix AArch64 JIT encoding of invalid logical immediates
2026-10-27 22:38:11 +01:00
Jorg Sowa 7d6e9e6f59 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Fix AArch64 JIT encoding of invalid logical immediates
2026-10-27 22:37:35 +01:00
Jorg Sowa 0dd0c2faaf Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix AArch64 JIT encoding of invalid logical immediates
2026-10-27 22:37:13 +01:00
Jorg Sowa aa6e3a84e8 Fix AArch64 JIT encoding of invalid logical immediates
dasm_imm13() accepted some non-encodable constants and returned a bogus
encoding, so AND/OR/XOR with them computed a wrong result
(0x5555555555555554) or emitted an illegal instruction (0x200000003).
It also negated INT64_MIN in signed arithmetic. Backport the rewritten
dasm_imm13() from DynASM (LuaJIT a9981441), already in master via the
IR update.

Closes GH-24663.
2026-10-27 22:37:01 +01:00
Jorg Sowa 6d2196792c Merge branch 'PHP-8.6'
* PHP-8.6:
  Fix JIT SWITCH_STRING type checks on referenced operand
2026-10-27 22:33:06 +01:00
Jorg Sowa f852fb7bcd Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Fix JIT SWITCH_STRING type checks on referenced operand
2026-10-27 22:33:05 +01:00
Jorg Sowa c647ee5736 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix JIT SWITCH_STRING type checks on referenced operand
2026-10-27 22:33:02 +01:00
Jorg Sowa ef873f64f3 Fix JIT SWITCH_STRING type checks on referenced operand
The tracing guard checked IS_LONG instead of IS_STRING after ZVAL_DEREF,
passing a non-string to zend_hash_find(). The function JIT path checked
IS_STRING instead of IS_REFERENCE, so the deref fast path was dead.

Closes GH-24796.
2026-10-27 22:32:49 +01:00
ndossche beb8d76332 Merge branch 'PHP-8.6'
* PHP-8.6:
  curl: Fix UAF on clone due to callback data pointer mismatch
2026-10-27 20:44:39 +01:00
ndossche f8176205c7 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  curl: Fix UAF on clone due to callback data pointer mismatch
2026-10-27 20:44:34 +01:00
ndossche 625892b770 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  curl: Fix UAF on clone due to callback data pointer mismatch
2026-10-27 20:44:17 +01:00
ndossche 154b090df2 curl: Fix UAF on clone due to callback data pointer mismatch
When curl opaque objects are cloned, the curl handle was only updated if
the callback function wasn't null. However, the C handler in PHP remains
attached even if the callback was set to NULL (*). So we must
unconditionally update the callback data pointer to the new curl handle.

(*) We can't set the C handler to NULL unconditionally on stable branches
because that invokes a behaviour change (e.g. built in progress bar).

Closes GH-24760.
2026-10-27 20:43:46 +01:00
ndossche fb7fb98f68 Merge branch 'PHP-8.6'
* PHP-8.6:
  opcache: Call orig_post_shutdown_cb()
  JIT: Discard veneers if generation failed
2026-10-27 20:40:18 +01:00
ndossche 0c122cc676 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  opcache: Call orig_post_shutdown_cb()
  JIT: Discard veneers if generation failed
2026-10-27 20:40:12 +01:00
ndossche 07e5953b27 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  opcache: Call orig_post_shutdown_cb()
  JIT: Discard veneers if generation failed
2026-10-27 20:39:54 +01:00
ndossche 37f495c3f5 opcache: Call orig_post_shutdown_cb()
This was never called and resulted in this compiler warning:

```
./ext/opcache/ZendAccelerator.c:3720:15: warning: variable 'orig_post_shutdown_cb' set
      but not used [-Wunused-but-set-global]
 3720 | static void (*orig_post_shutdown_cb)(void);
      |               ^
```

Closes GH-24761.
2026-10-27 20:39:21 +01:00
ndossche 11bea59cfb JIT: Discard veneers if generation failed
This is the final part to fix GH-24675, after e356f985f1.

Closes GH-24675.
Closes GH-24765.
2026-10-27 20:38:48 +01:00
ndossche 1d901925f0 Merge branch 'PHP-8.6'
* PHP-8.6:
  [ci skip] Skip test for MSAN
2026-10-27 20:36:52 +01:00
ndossche 76c8a4d13e Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  [ci skip] Skip test for MSAN
2026-10-27 20:36:46 +01:00
ndossche 6c1559d0e5 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [ci skip] Skip test for MSAN
2026-10-27 20:36:40 +01:00
ndossche de8c44e683 [ci skip] Skip test for MSAN 2026-10-27 20:36:09 +01:00
Weilin Du af192515a9 Merge branch 'PHP-8.6'
* PHP-8.6:
  Merge branch 'PHP-8.5' into PHP-8.6
2026-10-28 00:45:35 +08:00
Weilin Du f3dd8e1149 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Merge branch 'PHP-8.4' into PHP-8.5
2026-10-28 00:44:55 +08:00
Weilin Du 9fccc1cf4c Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-23875: Skip gh7980.phpt without windows-1258 (#24789)
2026-10-28 00:34:49 +08:00
Juan Versolato Lopes 98043f3a1c Fix GH-23875: Skip gh7980.phpt without windows-1258 (#24789)
The windows-1258 charset is optional on glibc systems and may be absent
from minimal installations. When iconv cannot open it, the test fails
with "Wrong encoding" instead of exercising iconv_mime_decode().

Probe support in SKIPIF and skip the test if the charset is unavailable,
following the existing iconv test pattern. The test continues to run
when windows-1258 is supported.

Closes #24789
2026-10-28 00:34:03 +08:00
Tim Düsterhus 0af8a091ee Merge branch 'PHP-8.6'
* PHP-8.6:
  sodium: Use opaque objects for SHAKE state (#24351)
2026-10-27 17:09:32 +01:00
Tim Düsterhus bdca5a9f49 sodium: Use opaque objects for SHAKE state (#24351)
* sodium: Use opaque objects for SHAKE state

* sodium: Make `sodium_crypto_xof_*shake*_update()` void

* sodium: Fix error message phrasing when requesting invalid lengths from SHAKE

* NEWS
2026-10-27 17:08:27 +01:00
Weilin Du b6f66ce55c ext/intl: Clarify ICU version requirements in intl test skip messages (#24776)
SKIP for ICU (version) is a very vague wording.
Use SKIP requires ICU (version) instead
2026-10-28 00:01:40 +08:00
David Carlier 6f301fa58b Merge branch 'PHP-8.6'
* PHP-8.6:
  Fix GH-24616: Socket transports accept ports above 65535
2026-10-27 15:37:35 +00:00
David Carlier fed2b4e17f Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Fix GH-24616: Socket transports accept ports above 65535
2026-10-27 15:37:34 +00:00
David Carlier 247199192c Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-24616: Socket transports accept ports above 65535
2026-10-27 15:37:28 +00:00