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

138584 Commits

Author SHA1 Message Date
David Carlier
2e263d26a2 Merge branch 'PHP-8.4' 2024-10-12 14:54:02 +01:00
David Carlier
42f877659d Fix GH-16359 curl write callback crash on FCC usage w/o user function.
close GH-16362
2024-10-12 14:53:22 +01:00
Niels Dossche
18ab3b9e6d Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix error message for newer libxml
  Backport 061058a9: Test fixes for libxml2 2.12.0
  Workaround deprecation warning in zend_test on 8.1
  Backport 3ec5919e: Update error message for libxml 2.13
  Backport f74f9b07: Update libxml test for the directory field behaviour change
  Backport 4fe82131: Backport libxml2 2.13.2 fixes (#14816)
  Backport e2d97314: Backport deprecation warning ignores to unbreak CI
  Backport 0a39890c: Fix libxml2 2.12 build due to API breaks
2024-10-12 15:14:32 +02:00
Niels Dossche
2577b89b8d Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix error message for newer libxml
  Backport 061058a9: Test fixes for libxml2 2.12.0
  Workaround deprecation warning in zend_test on 8.1
  Backport 3ec5919e: Update error message for libxml 2.13
  Backport f74f9b07: Update libxml test for the directory field behaviour change
  Backport 4fe82131: Backport libxml2 2.13.2 fixes (#14816)
  Backport e2d97314: Backport deprecation warning ignores to unbreak CI
  Backport 0a39890c: Fix libxml2 2.12 build due to API breaks
2024-10-12 15:14:25 +02:00
Niels Dossche
3d9e55c42d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix error message for newer libxml
  Backport 061058a9: Test fixes for libxml2 2.12.0
  Workaround deprecation warning in zend_test on 8.1
  Backport 3ec5919e: Update error message for libxml 2.13
  Backport f74f9b07: Update libxml test for the directory field behaviour change
  Backport 4fe82131: Backport libxml2 2.13.2 fixes (#14816)
  Backport e2d97314: Backport deprecation warning ignores to unbreak CI
  Backport 0a39890c: Fix libxml2 2.12 build due to API breaks
2024-10-12 15:14:14 +02:00
Niels Dossche
2554640804 Merge remote-tracking branch 'upstream/PHP-8.1' into PHP-8.2
* upstream/PHP-8.1:
  Fix error message for newer libxml
  Backport 061058a9: Test fixes for libxml2 2.12.0
  Workaround deprecation warning in zend_test on 8.1
  Backport 3ec5919e: Update error message for libxml 2.13
  Backport f74f9b07: Update libxml test for the directory field behaviour change
  Backport 4fe82131: Backport libxml2 2.13.2 fixes (#14816)
  Backport e2d97314: Backport deprecation warning ignores to unbreak CI
  Backport 0a39890c: Fix libxml2 2.12 build due to API breaks
2024-10-12 15:14:02 +02:00
Niels Dossche
2c40762b4e Fix error message for newer libxml
Normally I would backport 3354cc6e, but this doesn't apply cleanly due
to observer changes.
2024-10-12 15:12:40 +02:00
Niels Dossche
14c107371c Backport 061058a9: Test fixes for libxml2 2.12.0 2024-10-12 15:12:40 +02:00
Niels Dossche
5bd04acfe9 Workaround deprecation warning in zend_test on 8.1 2024-10-12 15:12:40 +02:00
Niels Dossche
6199289b6e Backport 3ec5919e: Update error message for libxml 2.13
External entity loading got its error level decreased in upstream,
which means they now map to E_NOTICE. Also the error message format has
changed.
2024-10-12 15:12:40 +02:00
Niels Dossche
b78618750f Backport f74f9b07: Update libxml test for the directory field behaviour change
See https://gitlab.gnome.org/GNOME/libxml2/-/issues/753.
The base directory for the entity is no longer set, follow the upstream
behaviour.
2024-10-12 15:12:40 +02:00
Niels Dossche
bb46b4b799 Backport 4fe82131: Backport libxml2 2.13.2 fixes (#14816)
Backproted from https://github.com/php/php-src/pull/14789
2024-10-12 15:12:40 +02:00
Niels Dossche
dbde99d875 Backport e2d97314: Backport deprecation warning ignores to unbreak CI
In master I use ZEND_DIAGNOSTIC_IGNORED_START, but that doesn't exist on
8.2 or 8.3 (8.3 has a similar macro though).
So to unbreak CI I just made a variation of this directly in the
php_libxml.h header.

See 683e787860 (commitcomment-134301083)
2024-10-12 15:12:40 +02:00
Niels Dossche
fa6a0f80f6 Backport 0a39890c: Fix libxml2 2.12 build due to API breaks
See https://github.com/php/php-src/actions/runs/7062192818/job/19225478601
2024-10-12 15:12:40 +02:00
Niels Dossche
a1974e6db0 Merge branch 'PHP-8.4'
* PHP-8.4:
  Restore accidentally deleted check
2024-10-12 13:41:29 +02:00
Niels Dossche
b7b0b954be Restore accidentally deleted check 2024-10-12 13:41:24 +02:00
Niels Dossche
105cf92a13 Merge branch 'PHP-8.4'
* PHP-8.4:
  Add missing hierarchy checks to replaceChild
  Fix GH-16337: Use-after-free in SplHeap
2024-10-12 13:39:13 +02:00
Niels Dossche
c31eac7284 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add missing hierarchy checks to replaceChild
  Fix GH-16337: Use-after-free in SplHeap
2024-10-12 13:39:06 +02:00
Niels Dossche
3ed01d454d Add missing hierarchy checks to replaceChild
You can break the hierarchy for attribute nodes, use the helper function
introduced recently [1] to fix this issue.

[1] 066d18f2

Closes GH-16377.
2024-10-12 13:32:13 +02:00
Niels Dossche
6902e196c3 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16337: Use-after-free in SplHeap
2024-10-12 13:31:50 +02:00
Niels Dossche
a56ff4fec7 Fix GH-16337: Use-after-free in SplHeap
We introduce a new flag to indicate when a heap or priority queue is
write-locked. In principle we could've used SPL_HEAP_CORRUPTED too, but
that won't be descriptive to users (and it's a lie too).

Closes GH-16346.
2024-10-12 13:31:23 +02:00
Niels Dossche
baa76be615 Use SWAR to seek for non-ASCII UTF-8 in DOM parsing (#16350)
GitHub FYP test case:
```
Benchmark 1: ./sapi/cli/php test.php
  Time (mean ± σ):     502.8 ms ±   6.2 ms    [User: 498.3 ms, System: 3.2 ms]
  Range (min … max):   495.2 ms … 509.8 ms    10 runs

Benchmark 2: ./sapi/cli/php_old test.php
  Time (mean ± σ):     518.4 ms ±   4.3 ms    [User: 513.9 ms, System: 3.2 ms]
  Range (min … max):   511.5 ms … 525.5 ms    10 runs

Summary
  ./sapi/cli/php test.php ran
    1.03 ± 0.02 times faster than ./sapi/cli/php_old test.php
```

Wikipedia English homepage test case:
```
Benchmark 1: ./sapi/cli/php test.php
  Time (mean ± σ):     301.1 ms ±   4.2 ms    [User: 295.5 ms, System: 4.8 ms]
  Range (min … max):   296.3 ms … 308.8 ms    10 runs

Benchmark 2: ./sapi/cli/php_old test.php
  Time (mean ± σ):     308.2 ms ±   1.7 ms    [User: 304.6 ms, System: 2.9 ms]
  Range (min … max):   306.9 ms … 312.8 ms    10 runs

Summary
  ./sapi/cli/php test.php ran
    1.02 ± 0.02 times faster than ./sapi/cli/php_old test.php
```
2024-10-12 13:29:33 +02:00
Niels Dossche
497dbaa2df Fix GH-16389: Assertion failure in ext/ldap/ldap.c:2718 (#16392) 2024-10-12 13:19:23 +02:00
Niels Dossche
7fae9f7397 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16385: Unexpected null returned by session_set_cookie_params
2024-10-12 13:09:31 +02:00
Niels Dossche
45f7f87b75 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16385: Unexpected null returned by session_set_cookie_params
2024-10-12 13:09:24 +02:00
Niels Dossche
a1f7ce5617 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16385: Unexpected null returned by session_set_cookie_params
2024-10-12 13:09:06 +02:00
Niels Dossche
7cdd1302c3 Fix GH-16385: Unexpected null returned by session_set_cookie_params
Two issues:
1) The check happened before ZPP checks
2) The `return;` statement caused NULL to be returned while this
   function can only return booleans. An exception seems not acceptable
   in stable versions, but a warning may do.

Closes GH-16386.
2024-10-12 13:08:37 +02:00
DanielEScherzer
24d11b7e6f RecursiveTreeIterator::__construct(): switch @param to typehint (#16215)
The type is enforced, and `TypeError`s are already thrown, but the
information about the required type is not provided to Reflection. Replace the
`@param` comment with a real typehint so that the information is also available
via Reflection.
2024-10-12 11:42:34 +01:00
Christoph M. Becker
89533482a4 Merge branch 'PHP-8.4'
* PHP-8.4:
  Backport 3237b8f471
2024-10-11 23:58:11 +02:00
Christoph M. Becker
e35380c2c2 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Backport 3237b8f471
2024-10-11 23:57:47 +02:00
Christoph M. Becker
382cd2f067 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Backport 3237b8f471
2024-10-11 23:56:48 +02:00
Christoph M. Becker
e8ef81a9b1 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Backport 3237b8f471
2024-10-11 23:56:19 +02:00
Saki Takamachi
8497400b23 Backport 3237b8f471
This should fix the PDO_OCI and oci8 test failures due to more verbose
output of Oracle DB 23.5.

Closes GH-16107.
2024-10-11 23:55:50 +02:00
Christoph M. Becker
0258b9d5a2 Run PHP-8.4 nightly on macOS 13
Cf. <https://github.com/php/php-src/pull/16375#issuecomment-2407919040>
2024-10-11 23:14:09 +02:00
Christoph M. Becker
7dda2deae8 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16367: macOS CI fails to configure ext/intl on master
2024-10-11 23:11:35 +02:00
Christoph M. Becker
37561823e9 Fix GH-16367: macOS CI fails to configure ext/intl on master
Closes GH-16375.
2024-10-11 23:10:29 +02:00
Niels Dossche
7ff940f2a2 Fix GH-16356: Segmentation fault with $outerHTML and next node (#16364)
`$outerHTML` should only serialize the current node, not its siblings.
2024-10-11 20:44:50 +02:00
David Carlier
2b39e72fac Merge branch 'PHP-8.4' 2024-10-11 19:38:58 +01:00
David Carlier
be370edbd7 Merge branch 'PHP-8.3' into PHP-8.4 2024-10-11 19:38:39 +01:00
David Carlier
d612b0a124 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-11 19:38:26 +01:00
David Carlier
f2859a4050 Fix GH-16322: imageaffine overflow on affine argument.
close GH-16334
2024-10-11 19:37:34 +01:00
Christoph M. Becker
b14076a4e6 Fix property access of PHP objects wrapped in variant
First, we fix the long standing issue that property access throws a
`com_exception` ("0x80020003: member not found), because the `HRESULT`
was not properly set after accessing the property.

Next, we fix an issue introduced as of PHP 7.0.0, where the string
length for write access had been properly adapted, but the string
length for read access had been overlooked.

Then we fix an issue introduced as of PHP 8.0.0, where new `HashTable`s
no longer set `nNextFreeElement` to zero, but to `ZEND_LONG_MIN`.  This
doesn't work well with the `DISPID` lookup, which is a `LONG`.

Finally we fix a potential double-free due to erroneously destroying
the return value of `zend_read_property()`.

Closes GH-16331.
2024-10-11 16:50:35 +02:00
Christoph M. Becker
9345582471 XLEAK bug78270_2.phpt (GH-16352)
This test leaks memory as some other ext/ffi tests, so we treat it in
the same way.

We also fix a typo in another test.
2024-10-11 10:27:37 +02:00
David Carlier
0323fffd4b Merge branch 'PHP-8.4' 2024-10-11 08:49:19 +01:00
David Carlier
f47a45ecff Merge branch 'PHP-8.3' into PHP-8.4 2024-10-11 08:49:00 +01:00
David Carlier
89b4f94024 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-11 08:48:49 +01:00
David Carlier
c34d4fbbf4 Fix GH-16360 mb_substr overflow on start and length arguments.
occurs when they are negated to start working from the end instead
when set with ZEND_LONG_MIN.
2024-10-11 08:46:48 +01:00
Niels Dossche
5bb987b3a3 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16168: php 8.1 and earlier crash immediately when compiled with Xcode 16 clang on macOS 15
2024-10-11 09:14:32 +02:00
Niels Dossche
5b0b151bb2 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16168: php 8.1 and earlier crash immediately when compiled with Xcode 16 clang on macOS 15
2024-10-11 09:14:26 +02:00
Niels Dossche
e4a23e920d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16168: php 8.1 and earlier crash immediately when compiled with Xcode 16 clang on macOS 15
2024-10-11 09:14:10 +02:00