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

133462 Commits

Author SHA1 Message Date
Ilija Tovilo
dab5aba45a Merge branch 'PHP-8.3'
* PHP-8.3:
  Use separate sqlsrv dbs for different exts
2023-10-02 12:56:11 +02:00
Ilija Tovilo
769f41bb21 Use separate sqlsrv dbs for different exts
This refers to pdo_dblib, pdo_odbc and odbc in particular.

Closes GH-12342
2023-10-02 12:55:57 +02:00
Ilija Tovilo
fcae58809f Fix GCC warning in math.c 2023-10-02 10:55:57 +02:00
Niels Dossche
b56141c5dd Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix broken cache invalidation with deallocated and reallocated document node
2023-10-01 17:07:11 +02:00
Niels Dossche
eebc528cbf Fix broken cache invalidation with deallocated and reallocated document node
The original caching implementation had an oversight in combination with
the new lifetime management in DOM for 8.3.
The modification counter is stored on the document object itself, but as
that can get deallocated when all references disappear, stale cache data
can be used. Normally this isn't a problem, unless getElementsByTagName is
called not on the document but on a child node. Fix it by moving caching
data into the ref object, which will outlive all nodes from a document
even if the document object disappears.

Closes GH-12338.
2023-10-01 17:06:02 +02:00
Alex Dowad
9aa4b2bbad Add tests to document behavior of UTF7-IMAP conversion in obscure corner case
These unit tests cover situations which were not previously tested by the
mbstring test suite. Adding them will make the test suite more complete.

To be specific, the 'obscure' case which we are now testing is: what happens
when the first half of a surrogate pair appears at end of an improperly
terminated Base64 section in UTF7-IMAP text?
2023-10-01 14:44:05 +02:00
Alex Dowad
a57fdea149 Add assertion to mb_utf7imap_to_wchar to catch buffer overrun
I don't believe such a buffer overrun will ever occur, but just in
case the code is changed in the future, it will be good to have an
assertion here to help catch bugs. (A similar assertion is already
used in the UTF-7 version of this function.)
2023-10-01 14:43:35 +02:00
David CARLIER
3944bb01eb zend call stack for DragonFlyBSD. (#12325)
Shares the same codepaths as FreeBSD for the most part.
2023-10-01 13:12:14 +01:00
Niels Dossche
f10e1b8f59 Use RETURN_STR_COPY() in xsl
Everything in intern->parameter is already a string.
2023-09-30 21:41:11 +02:00
Niels Dossche
5c749ad4cf Implement request #64137 (XSLTProcessor::setParameter() should allow both quotes to be used)
This reimplements the parameter handling. Instead of quoting the strings
manually, adding them to an array, and passing that as input; use the
libxslt API to pass data verbatim to the processor.
This also simplifies the code a lot.

Closes GH-12331.
2023-09-30 21:41:06 +02:00
Anatol Belski
f550c082dd Merge branch 'PHP-8.3'
* PHP-8.3:
  NEWS: Add note about #11891
  NEWS: Added note about #11891
  NEWS: Added note about #11891
2023-09-30 19:20:08 +02:00
Anatol Belski
31a44c8ca7 NEWS: Add note about #11891
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2023-09-30 19:19:44 +02:00
Anatol Belski
36d7d4d17a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  NEWS: Added note about #11891
  NEWS: Added note about #11891
2023-09-30 19:18:43 +02:00
Anatol Belski
1934da0a81 NEWS: Added note about #11891
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2023-09-30 19:18:25 +02:00
Anatol Belski
e181af7018 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  NEWS: Added note about #11891
2023-09-30 19:17:36 +02:00
Anatol Belski
a1225f35bb NEWS: Added note about #11891
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2023-09-30 19:16:42 +02:00
Anatol Belski
022057b907 Merge branch 'PHP-8.3'
* PHP-8.3:
  fileinfo: Backport svg detection patch
2023-09-30 18:26:23 +02:00
Anatol Belski
bd24c56207 fileinfo: Backport svg detection patch
This patch is a port of 1f5bea34 and adds a port for 5.43 based
branches. The related test is unchanged.

Signed-off-by: Anatol Belski <ab@php.net>
2023-09-30 18:22:14 +02:00
Niels Dossche
3e29332a5c Merge branch 'PHP-8.3'
* PHP-8.3:
  Apply SimpleXML iterator fixes only on master
2023-09-30 18:02:59 +02:00
Niels Dossche
ec2ef6465d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Apply SimpleXML iterator fixes only on master
2023-09-30 17:55:34 +02:00
Niels Dossche
77f44b2281 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Apply SimpleXML iterator fixes only on master
2023-09-30 17:53:57 +02:00
Niels Dossche
b842ea4fa8 Apply SimpleXML iterator fixes only on master
Many methods in SimpleXML reset the iterator when called. This has the
consequence that mixing these operations with loops can cause infinite
loops, or the loss of iteration data.
Some people may however rely on the resetting behaviour. To prevent
unintended breaks in stable branches, let's only apply the fix to master.

This reverts GH-12193, GH-12229, GG-12247 for stable branches while
keeping them on master, adding a note in UPGRADING as well.
2023-09-30 17:48:05 +02:00
Anatol Belski
2546bbd3bc Merge branch 'PHP-8.3'
* PHP-8.3:
2023-09-30 16:52:53 +02:00
Anatol Belski
7efc531e08 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  fileinfo: Backport svg detection patch
2023-09-30 16:52:17 +02:00
Anatol Belski
b79a2403b5 Merge branch 'PHP-8.2'
* PHP-8.2:
  fileinfo: Backport svg detection patch
2023-09-30 16:33:39 +02:00
Anatol Belski
4b22cb213a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  fileinfo: Backport svg detection patch
2023-09-30 16:26:24 +02:00
Niels Dossche
b67530a6c0 Add test for XSLTProcessor::getParameter() 2023-09-30 16:25:07 +02:00
usarise
1f5bea3452 fileinfo: Backport svg detection patch 2023-09-30 16:17:03 +02:00
Niels Dossche
2fb9ef069f Merge branch 'PHP-8.3'
* PHP-8.3:
  Revert "Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT"
2023-09-30 01:27:43 +02:00
Niels Dossche
04a2a42f2a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Revert "Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT"
2023-09-30 01:27:29 +02:00
Niels Dossche
0f5b382528 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Revert "Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT"
2023-09-30 01:27:06 +02:00
Niels Dossche
643c4ba417 Revert "Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT"
Although it passes CI on 8.1, it causes CI failures in the JIT on 8.2 and
higher.
See https://github.com/php/php-src/actions/runs/6357716718/job/17269225001

This reverts commit e72fc12058.
2023-09-30 01:25:48 +02:00
Niels Dossche
5fd89652e5 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix compile error with -Werror=incompatible-function-pointer-types and old libxml2
  Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
  Fix type error on XSLTProcessor::transformToDoc return value with SimpleXML
2023-09-30 00:12:42 +02:00
Niels Dossche
df89409aba Fix compile error with -Werror=incompatible-function-pointer-types and old libxml2
libxml2 prior to 2.9.8 had a different signature for xmlHashScanner.
This signature changed in e03f0a199a
Use an #if to work around the incompatible signature.

Closes GH-12326.
2023-09-30 00:12:20 +02:00
Niels Dossche
fa2d556fcd Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
  Fix type error on XSLTProcessor::transformToDoc return value with SimpleXML
2023-09-30 00:11:31 +02:00
Niels Dossche
d7a7309b53 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
  Fix type error on XSLTProcessor::transformToDoc return value with SimpleXML
2023-09-30 00:10:35 +02:00
Niels Dossche
e72fc12058 Fix GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
This test triggers narrowing for two ops: first ZEND_ADD_ARRAY_ELEMENT,
and then ZEND_ASSIGN.

The type inference happens in the following order:
1) The ZEND_ADD_ARRAY_ELEMENT infers type 0x40e04080 (packed flag is set),
   arr_type=0 at this point because it hasn't been set by ZEND_INIT_ARRAY yet.
2) The ZEND_INIT_ARRAY infers type 0x40804080
3) The ZEND_ADD_ARRAY_ELEMENT infers type 0x40e04080, arr_type=0x40804080,
   which does not have the packed flag set while the existing result of
   ZEND_ADD_ARRAY_ELEMENT has the packed flag set.

This seems to occur because of the phi node introduced by the while
loop. If I remove the loop the problem goes away.

As Arnaud noted, this seems to be caused by a too wide type inference
for arr_type==0. We should keep the invariant that if x>=y then
key_type(x) >= key_type(y).
If we write the possible results down in a table we get:

```
arr_type           resulting key type
---------------    --------------------------------------------------------------------------
HASH_ONLY	-> MAY_BE_ARRAY_NUMERIC_HASH
PACKED_ONLY	-> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG)
HASH || PACKED	-> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG)
0		-> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG)
```

As we can see, `HASH_ONLY > 0` but
`MAY_BE_ARRAY_NUMERIC_HASH < MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED`,
which violates the invariant.
Instead if we modify the zero case to have MAY_BE_ARRAY_NUMERIC_HASH instead,
we get the following table which satisfies the invariant.

```
arr_type           resulting key type
---------------    --------------------------------------------------------------------------
HASH_ONLY	-> MAY_BE_ARRAY_NUMERIC_HASH
PACKED_ONLY	-> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG)
HASH || PACKED	-> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG)
0		-> MAY_BE_ARRAY_NUMERIC_HASH
```

Broke in 1ffbb73.
Closes GH-10294.
2023-09-30 00:08:32 +02:00
Niels Dossche
2a7f23e9b9 Fix type error on XSLTProcessor::transformToDoc return value with SimpleXML
The return type is wrong. You can also use this method with SimpleXML.
In fact, PHP provides a way that even third party libraries can hook
into its XML handling. Therefore, we cannot even use the
SimpleXML|DOMDocument|false union type as third party extensions may
extend the possibilities.

Broke in 8.1 in 1b35056a33.

Closes GH-12315.
2023-09-30 00:03:42 +02:00
George Peter Banyard
6a4031b8c4 ext/mysqli: Work on making tests parallizable (#11814)
Batch 1 of amending tests, so they can run in parallel.

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
2023-09-29 18:57:30 +01:00
Remi Collet
7200bc23a0 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix port conflict 64324 used in bug51056.phpt
2023-09-29 14:02:57 +02:00
Remi Collet
80266f80d4 Fix port conflict 64324 used in bug51056.phpt 2023-09-29 14:02:42 +02:00
twosee
dcee59eb33 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix socket_export_stream() with wrong protocol
2023-09-29 18:59:17 +08:00
twosee
d9b0bdbaa4 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix socket_export_stream() with wrong protocol
2023-09-29 18:58:05 +08:00
David CARLIER
14b827049a zend call stack support for haiku w/o using posix pthread api but the (#12103)
underlying native BeOs one.
2023-09-29 11:47:23 +01:00
Jakub Zelenka
569b95d2c3 Merge branch 'PHP-8.3' 2023-09-29 11:39:41 +01:00
Jakub Zelenka
517411d2fb Prepare NEWS for PHP 8.3.0RC4 2023-09-29 11:38:28 +01:00
twosee
90707f33e1 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix socket_export_stream() with wrong protocol
2023-09-29 18:33:59 +08:00
twosee
b5da98b972 Fix socket_export_stream() with wrong protocol
Closes GH-12310.
2023-09-29 18:33:12 +08:00
Niels Dossche
0b7a0e9f41 Merge branch 'PHP-8.3'
* PHP-8.3:
  Restore old namespace reconciliation behaviour
2023-09-27 22:41:09 +02:00
Niels Dossche
6a2b885155 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Restore old namespace reconciliation behaviour
2023-09-27 22:40:37 +02:00