Commit Graph

14503 Commits

Author SHA1 Message Date
Ilija Tovilo
6b9d295674
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix serialization of RC1 objects appearing in object graph twice
2023-06-28 21:16:51 +02:00
Ilija Tovilo
d7d36692fd
Fix serialization of RC1 objects appearing in object graph twice
Previously, if an object had RC1 it would never be recorded in
php_serialize_data.ht because it was assumed that it could not be encountered
again. This assumption is incorrect though as the object itself may be saved
inside an array with RCn. This results in a new instance of the object, instead
of a second reference to the same object.

This is solved by tracking these objects in php_serialize_data.ht. To retain
performance, track if the current object resides in a potentially nested RCn
array. If not, and if the object is RC1 itself it may be omitted from
php_serialize_data.ht.

Additionally, we may treat the array root itself as RC1 because it may not
appear in the object graph again without recursion. Recursive arrays are still
somewhat broken even with this change, as the tracking of the array only happens
when the reference is encountered, thus resulting in a -> a' -> a' for a self
recursive array a -> a. Recursive arrays have limited support in serialize
anyway, so we ignore this case for now.

Co-authored-by: Dmitry Stogov <dmitry@zend.com>
Co-authored-by: Martin Hoch <martin@littlerobot.de>

Closes GH-11349
Closes GH-11305
2023-06-28 21:15:03 +02:00
Ilija Tovilo
54dfa86728
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix mis-compilation of by-reference nullsafe operator
2023-06-28 20:36:30 +02:00
Ilija Tovilo
dc73b73f8b
Fix mis-compilation of by-reference nullsafe operator
Fixes oss-fuzz #60011
Closes GH-11540

Co-authored-by: Dmitry Stogov <dmitry@zend.com>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2023-06-28 20:35:29 +02:00
Niels Dossche
ac60c5c70c Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11522: PHP version check fails with '-' separator
2023-06-27 18:29:09 +02:00
SVGAnimate
3483229199 Fix GH-11522: PHP version check fails with '-' separator
Remove php version suffix from '-' separator.

Closes GH-11524.
2023-06-27 18:28:04 +02:00
Niels Dossche
1288c07ba6 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix context option check for "overwrite" in FTP
2023-06-27 17:54:39 +02:00
Jonas
1d369a871d Fix context option check for "overwrite" in FTP
Use zend_is_true() to read value of FTP context option "overwrite".

Closes GH-11332.
2023-06-27 17:53:45 +02:00
Niels Dossche
022b6aa4cb Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11498: SIGCHLD is not always returned from proc_open
2023-06-23 21:58:05 +02:00
nielsdos
f39b513916 Fix GH-11498: SIGCHLD is not always returned from proc_open
Linux, and maybe other unixes, may merge multiple standard signals into
a single one. This causes issues when keeping track of process IDs.
Solve this by manually checking which children are dead using waitpid().

Test case is based on taka-oyama's test code.

Closes GH-11509.
2023-06-23 21:56:21 +02:00
nielsdos
daa891ed42 [ci skip] Add forgotten NEWS entry 2023-06-23 17:50:41 +02:00
nielsdos
b9bf9ee2cb Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix interrupted CLI output causing the process to exit
2023-06-23 17:42:45 +02:00
nielsdos
1111a9517b Fix interrupted CLI output causing the process to exit
When writing the output in the CLI is interrupted by a signal, the
writing will fail in sapi_cli_single_write(), causing an exit later in
sapi_cli_ub_write(). This was the other part of the issue in GH-11498.
The solution is to restart the write if an EINTR has been observed.

Closes GH-11510.
2023-06-23 17:39:04 +02:00
Ilija Tovilo
7f9ad4a83a
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Revert "Mangle PCRE regex cache key with JIT option"
2023-06-22 23:14:27 +02:00
nielsdos
c44f79b7d5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11492: Make test failure: ext/pdo_sqlite/tests/bug_42589.phpt
2023-06-22 20:51:11 +02:00
Vinicius Dias
039dd0b4bd Fix GH-11492: Make test failure: ext/pdo_sqlite/tests/bug_42589.phpt
Closes GH-11494.
2023-06-22 20:49:00 +02:00
Derick Rethans
0747616f84 Fixed GH-11368: Date modify returns invalid datetime 2023-06-22 17:58:19 +01:00
Ilija Tovilo
1441f30a8d
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Remove session ID set through REQUEST_URI
2023-06-22 12:36:52 +02:00
Ilija Tovilo
f160eff441
Remove session ID set through REQUEST_URI 2023-06-22 12:35:55 +02:00
Ilija Tovilo
34a1a1bddb
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Mangle PCRE regex cache key with JIT option
2023-06-22 11:10:59 +02:00
Michael Voříšek
466fc78d2c
Mangle PCRE regex cache key with JIT option
Closes GH-11396
2023-06-22 11:08:54 +02:00
Remi Collet
f26aff1b66
[ci skip] add CVE in NEWS 2023-06-22 08:06:11 +02:00
Remi Collet
2be4d91f82
[ci skip] add CVE in NEWS 2023-06-22 08:04:56 +02:00
Sergey Panteleev
884a53f39a
PHP-8.2 is now for PHP 8.2.9-dev 2023-06-20 17:25:30 +03:00
Patrick Allaert
6c4b1e0417
PHP-8.1 is now for PHP 8.1.22-dev 2023-06-20 16:07:05 +02:00
Niels Dossche
93becab506 Fix GH-11455: Segmentation fault with custom object date properties
Closes GH-11473.
2023-06-19 19:42:09 +02:00
nielsdos
de0223113a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Revert "Fix GH-11404: DOMDocument::savexml and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM"
2023-06-19 19:38:30 +02:00
nielsdos
c174ebfce0 Revert "Fix GH-11404: DOMDocument::savexml and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM"
This reverts commit 7eb3e9cd17.

Although the fix follows the spec, it causes issues because a lot of old
code assumes the incorrect behaviour PHP had since a long time.
We cannot do this yet, especially not in a stable release.
We revert this for the time being.
See GH-11428.
2023-06-19 19:37:46 +02:00
Niels Dossche
862487e95e Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix #80332: Completely broken array access functionality with DOMNamedNodeMap
2023-06-18 15:02:46 +02:00
Niels Dossche
9f7d88802e Fix #80332: Completely broken array access functionality with DOMNamedNodeMap
The problem is the usage of zval_get_long(). In particular, if the
string is non-numeric the result of zval_get_long() will be 0 without
giving an error or warning. This is misleading for users: users get the
impression that they can use strings to access the map because it
coincidentally works for the first item (which is at index 0). Of
course, this fails with any other index which causes confusion and bugs.

This patch adds proper support for using string offsets while accessing
the map. It does so by detecting if it's a non-numeric string, and then
using the getNamedItem() method instead of item(). I had to split up the
array access implementation code for DOMNodeList and DOMNamedNodeMap
first to be able to do this.

Closes GH-11468.
2023-06-18 14:59:19 +02:00
David Carlier
bc45b34b30 Merge branch 'PHP-8.1' into PHP-8.2 2023-06-18 13:45:30 +01:00
David CARLIER
f194cdf852 ext/pgsql: fix PGtrace invalid free issue.
disable trace when closing the connection, is a no op if there is no stream
attached to it.

Close GH-11403
2023-06-18 13:44:39 +01:00
Niels Dossche
bb3e5a8f55 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11404: DOMDocument::savexml and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM
2023-06-17 13:36:44 +02:00
nielsdos
7eb3e9cd17 Fix GH-11404: DOMDocument::savexml and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM
The NULL namespace is only correct when there is no default namespace
override. When there is, we need to manually set it to the empty string
namespace.

Closes GH-11428.
2023-06-17 13:36:00 +02:00
nielsdos
29a96e09b2 Fix GH-11451: Invalid associative array containing duplicate keys
It used the "add_new" variant which assumes the key doesn't already
exist. But in case of duplicate keys we have to take the last result.

Closes GH-11453.
2023-06-15 21:56:06 +02:00
nielsdos
923e72615f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix bug #55294 and #47530 and #47847: namespace reconciliation issues
2023-06-15 21:50:47 +02:00
nielsdos
b30be40b86 Fix bug #55294 and #47530 and #47847: namespace reconciliation issues
We'll use the DOM wrapper version of libxml2 instead of the regular one.
It's conforming to the behaviour we expect of DOM.
Most of this patch is tests.

I based and extended the tests on the code attached with the aforementioned
bug reports. Therefore the credits for the tests:
Co-authored-by: hilse at web dot de
Co-authored-by: robin2008 at altruists dot org
Co-authored-by: sgunderson at bigfoot dot com

We'll also change the searching point of the internal reconciliation to
start at the top of the added tree to avoid redundant work now that the
function is changed.

Closes GH-11454.
2023-06-15 21:50:00 +02:00
nielsdos
a9c6b840ad Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix cross-compilation check in phar generation for FreeBSD
2023-06-13 19:13:34 +02:00
Peter
4fcb3e0d34 Fix cross-compilation check in phar generation for FreeBSD
FreeBSD's shell is very POSIX strict. This patch makes sure it works
correctly under FreeBSD too.

Closes GH-11441.
2023-06-13 19:09:58 +02:00
nielsdos
c160693515 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11433: Unable to set CURLOPT_ACCEPT_ENCODING to NULL
  Fix "invalid state error" with cloned namespace declarations
  Fix lifetime issue with getAttributeNodeNS()
2023-06-13 17:35:16 +02:00
nielsdos
a8a3b99e00 Fix GH-11433: Unable to set CURLOPT_ACCEPT_ENCODING to NULL
Closes GH-11446.
2023-06-13 17:30:57 +02:00
Niels Dossche
10d94aca4c Fix "invalid state error" with cloned namespace declarations
Closes GH-11429.
2023-06-13 17:30:18 +02:00
Niels Dossche
e309fd8461 Fix lifetime issue with getAttributeNodeNS()
It's the same issue that I fixed previously in GH-11402, but in a
different place.

Closes GH-11422.
2023-06-13 17:29:37 +02:00
Niels Dossche
2cbb0c0cc0 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix #70359 and #78577: segfaults with DOMNameSpaceNode
2023-06-09 21:41:49 +02:00
nielsdos
f2d673fb18 Fix #70359 and #78577: segfaults with DOMNameSpaceNode
* Fix type confusion and parent reference
* Manually manage the lifetime of the parent
* Add regression tests
* Break out to a helper, and apply the use-after-free fix to xpath

Closes GH-11402.
2023-06-09 21:35:55 +02:00
Jakub Zelenka
58141f062b
Merge branch 'PHP-8.1' into PHP-8.2 2023-06-09 16:38:14 +01:00
James Lucas
fd09728bb6
Fix bug GH-9356: Incomplete SAN validation of IPv6 address
IPv6 addresses are valid entries in subjectAltNames. Certificate
Authorities may issue certificates including IPv6 addresses except
if they fall within addresses in the RFC 4193 range. Google and
CloudFlare provide IPv6 addresses in their DNS over HTTPS services.

Internal CAs do not have those restrictions and can issue Unique
local addresses in certificates.

Closes GH-11145
2023-06-09 16:33:46 +01:00
Pierrick Charron
269d6c5942
Update NEWS 2023-06-06 18:10:06 -04:00
Pierrick Charron
5604f7ae22
Update NEWS 2023-06-06 18:06:13 -04:00
Niels Dossche
5b79c53682 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix bug #77686: Removed elements are still returned by getElementById
  Fix bug #81642: DOMChildNode::replaceWith() bug when replacing a node with itself
  Fix bug #67440: append_node of a DOMDocumentFragment does not reconcile namespaces
2023-06-04 16:27:03 +02:00