Commit graph

64811 commits

Author SHA1 Message Date
Niels Dossche
55432bfa16 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-11956: PCRE regular expressions with JIT enabled gives different result
2023-09-18 20:15:24 +02:00
Niels Dossche
1bed209363 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11956: PCRE regular expressions with JIT enabled gives different result
2023-09-18 20:14:47 +02:00
Niels Dossche
15bbae7bc9 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11956: PCRE regular expressions with JIT enabled gives different result
2023-09-18 20:13:45 +02:00
Niels Dossche
d61efdfe97 Fix GH-11956: PCRE regular expressions with JIT enabled gives different result
The code in the attached test used to work correctly in PHP 8.0, but not
in 8.1+. This is because PHP 8.1+ uses a more modern version of pcre2
than PHP 8.0, and that pcre2 versions has a regression.

While upgrading pcre2lib seems to be only done for the master branch, it
is possible to backport upstream fixes to stable branches. This has been
already done in the past in for JIT regressions [1], so it is not
unprecedented.

We backport the upstream pcre2 fix [2].

[1] 788a701e22
[2] https://github.com/PCRE2Project/pcre2/pull/135

Closes GH-12108.
2023-09-18 20:11:56 +02:00
George Peter Banyard
bc4807c506
ext/pcntl: Remove useless call to zend_get_callable_name() (#12241)
Result of it is unused
2023-09-18 17:35:36 +01:00
Christian Clauss
886bf820c9
[skip ci] Fix typos discovered by codespell (#12228) 2023-09-18 11:07:17 +01:00
Niels Dossche
7f0705b1fa Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-12208: SimpleXML infinite loop when a cast is used inside a foreach
2023-09-17 16:35:39 +02:00
Niels Dossche
673babed24 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12208: SimpleXML infinite loop when a cast is used inside a foreach
2023-09-17 16:35:11 +02:00
Niels Dossche
f4f34b6e5a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-12208: SimpleXML infinite loop when a cast is used inside a foreach
2023-09-17 16:34:38 +02:00
Niels Dossche
486276f0f9 Fix GH-12208: SimpleXML infinite loop when a cast is used inside a foreach
Closes GH-12229.
2023-09-17 16:33:32 +02:00
Niels Dossche
8f9626c0f7 Simplify php_sxe_count_elements_helper() by using non-destructive iterator reset 2023-09-17 16:21:54 +02:00
Niels Dossche
fe98a16af7 Add a test case for iterator and empty & var_dump interactions 2023-09-17 16:21:54 +02:00
Niels Dossche
550ec29821 Use php_sxe_reset_iterator_no_clear_iter_data() to avoid having to store and restore iterator data
This makes the code less error-prone, and also makes it simpler.
2023-09-17 16:21:54 +02:00
Niels Dossche
695ec3c97e
Remove unnecessary _IS_BOOL case (#12230)
This can never be executed because booleans are handled in a special
case at the top of sxe_object_cast_ex().
2023-09-17 16:19:22 +02:00
Niels Dossche
fad0e4f4e7 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
  Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
  Fix GH-12186: segfault copying/cloning a finalized HashContext
2023-09-16 21:28:59 +02:00
Niels Dossche
4bb27e2d9b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
  Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
  Fix GH-12186: segfault copying/cloning a finalized HashContext
2023-09-16 21:28:24 +02:00
Niels Dossche
5df473d2c7 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
  Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
  Fix GH-12186: segfault copying/cloning a finalized HashContext
2023-09-16 21:24:20 +02:00
Niels Dossche
39a9e561f9 Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r
Closes GH-12223.
2023-09-16 21:19:58 +02:00
Niels Dossche
4d888cf53f Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach
This happens because getName() resets the iterator to the start because
it overwrites the iterator data.
We add a version of get_first_node that does not overwrite the iterator
data.

Closes GH-12193.
2023-09-16 21:19:28 +02:00
Max Semenik
10f5a06d3c Fix GH-12186: segfault copying/cloning a finalized HashContext
Closes GH-12186.
Closes GH-12187.
2023-09-16 21:18:27 +02:00
Niels Dossche
0fee720173 Simplify node check in simplexml 2023-09-16 14:02:48 +02:00
Peter Kokot
a8e1b1018d Remove unused --with-zlib-dir configure option
Commits that removed this option:
- 34dd032e4e
- a2c21e10b2
- e595f5cd8a

Closes GH-12209
2023-09-14 22:21:54 +02:00
Niels Dossche
e5252a3f4d Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-12170: Can't use xpath with comments in SimpleXML
2023-09-14 18:45:01 +02:00
Niels Dossche
60b1673b20 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12170: Can't use xpath with comments in SimpleXML
2023-09-14 18:44:39 +02:00
Niels Dossche
b3bce2328f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-12170: Can't use xpath with comments in SimpleXML
2023-09-14 18:42:47 +02:00
Niels Dossche
747335f100 Fix GH-12170: Can't use xpath with comments in SimpleXML
Closes GH-12177.
2023-09-14 18:42:16 +02:00
Tim Düsterhus
b2d244a444
Show the integer size in phpinfo() (#12201)
Resolves GH-12188
2023-09-14 14:42:10 +02:00
Ilija Tovilo
ddd2bd42ea
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix filter_var with callback and explicit REQUIRE_SCALAR
2023-09-14 11:49:57 +02:00
Ilija Tovilo
b169725757
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix filter_var with callback and explicit REQUIRE_SCALAR
2023-09-14 11:49:44 +02:00
Ilija Tovilo
85ceb91789
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix filter_var with callback and explicit REQUIRE_SCALAR
2023-09-14 11:49:10 +02:00
Ilija Tovilo
c2fb10d2d2
Fix filter_var with callback and explicit REQUIRE_SCALAR
For some reason, FILTER_CALLBACK disables the FILTER_REQUIRE_SCALAR flag that is
normally set by default. While surprising, this is not something we can change.

However, even specifying FILTER_REQUIRE_SCALAR explicitly does not corrently set
this flag. This is because FILTER_CALLBACK zeroes the flags after they have been
populated from the parameters.

We reverse the checks to make explicitly specifying the flag behave as expected.

Closes GH-12203
2023-09-14 11:48:40 +02:00
Ilija Tovilo
692cea5cbc
Use zend_error_noreturn for E_ERROR consistently
To be clear, these already don't return. zend_error_noreturn just hints at this
fact through the ZEND_NORETURN attribute.

Closes GH-12204
2023-09-14 11:44:55 +02:00
Niels Dossche
05c46b71d4
Small optimization in php_sxe_get_first_node() by avoiding unwrapping iterator data (#12194) 2023-09-13 22:47:09 +02:00
Remi Collet
cc36d8dc6f
Merge branch 'PHP-8.3'
* PHP-8.3:
  zip: add new test for dynamic files
2023-09-12 11:18:50 +02:00
Remi Collet
57123ee489
zip: add new test for dynamic files 2023-09-12 11:18:18 +02:00
Niels Dossche
6b54811547 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix #52751: XPath processing-instruction() function is not supported.
2023-09-11 00:15:32 +02:00
Niels Dossche
2440af0f97 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix #52751: XPath processing-instruction() function is not supported.
2023-09-11 00:13:25 +02:00
Niels Dossche
d1ef22585f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix #52751: XPath processing-instruction() function is not supported.
2023-09-11 00:12:16 +02:00
Niels Dossche
107443b311 Fix #52751: XPath processing-instruction() function is not supported.
Closes GH-12165.
2023-09-11 00:08:29 +02:00
Niels Dossche
f2fede56c8 Deduplicate ParentNode and ChildNode interface implementations using @implementation-alias
The entry points are duplicated: they add bloat and make it easier to forget
to change something. Make maintenance easier by using @implementation-alias.
Also, this has the nice side-effect of slightly reducing the amount of
code and binary size.

Closes GH-12158.
2023-09-10 22:35:58 +02:00
Niels Dossche
bec1552a06
Remove useless SKIP_TEXT() invokes (#12164)
In the places I removed them, they were useless because there is already
a type check for a single node type, so I found it confusing having them
there.
2023-09-10 00:02:17 +02:00
Niels Dossche
d18bab5562 Preallocate result array size in simplexml xpath
This is the simplexml version of 4dea42a.
2023-09-09 22:59:24 +02:00
Niels Dossche
0ea268b51a Remove obsolete libxml2 code
LIBXML2_NEW_BUFFER is always defined since libxml2 2.9.0.
That's the minimum version PHP requires, so it will always be defined.
2023-09-09 21:58:13 +02:00
Niels Dossche
518233c39d Merge branch 'PHP-8.3'
* PHP-8.3:
  Use zend_get_gc_buffer_add_fcc()
2023-09-09 20:00:18 +02:00
Niels Dossche
49980ee89d Use zend_get_gc_buffer_add_fcc() 2023-09-09 20:00:01 +02:00
Niels Dossche
c7777e354d Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix build with sqlite3 gc and fci/fcc api
2023-09-09 16:07:17 +02:00
Niels Dossche
1d59b37742 Fix build with sqlite3 gc and fci/fcc api 2023-09-09 16:07:10 +02:00
Niels Dossche
c8e2765ba3 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
2023-09-09 15:35:11 +02:00
Niels Dossche
cb6fac5b8a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
2023-09-09 15:35:03 +02:00
Niels Dossche
6851c7b867 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
2023-09-09 15:34:38 +02:00