Commit graph

69597 commits

Author SHA1 Message Date
Dmitry Stogov
9dd2ae4d76
Merge branch 'PHP-8.4'
* PHP-8.4:
  Merge IR
2025-03-03 23:48:30 +03:00
Dmitry Stogov
f016caa312
Merge IR
IR commit: 1a02c4819f210a1f4548b83850ed7cd5c76c13aa
2025-03-03 23:48:08 +03:00
Gina Peter Banyard
9285559c8c ext/bz2: Use new php_streams fast ZPP specifier 2025-03-03 18:08:23 +00:00
Gina Peter Banyard
ff40eed32d ext/hash: Use new php_streams fast ZPP specifier 2025-03-03 18:08:23 +00:00
Gina Peter Banyard
eb4ccf5758 ext/pgsql: Use new php_streams fast ZPP specifier 2025-03-03 18:08:23 +00:00
Gina Peter Banyard
c9d23c96d6 ext/ftp: Use new php_streams fast ZPP specifier 2025-03-03 18:08:23 +00:00
Gina Peter Banyard
da1fde28f3 ext/standard: Use new php_streams fast ZPP specifier 2025-03-03 18:08:23 +00:00
Gina Peter Banyard
f3857dd613 ext/standard: Use new php_streams fast ZPP specifier for stream functions 2025-03-03 18:08:23 +00:00
Gina Peter Banyard
8787fa2a36 ext/standard: Use new php_streams fast ZPP specifier for file functions
Fix a corresponding test
2025-03-03 18:08:23 +00:00
Niels Dossche
0097ad8eb3
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17938: UAF with zend_test opline observer and magic_quotes_gpc=1 (#17958)
2025-03-03 08:22:55 +01:00
Niels Dossche
4c751ec04c
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17938: UAF with zend_test opline observer and magic_quotes_gpc=1 (#17958)
2025-03-03 08:22:49 +01:00
Niels Dossche
504056888c
Fix GH-17938: UAF with zend_test opline observer and magic_quotes_gpc=1 (#17958) 2025-03-03 08:20:48 +01:00
Niels Dossche
1ae2c871d0
Avoid unnecessary string refcounting in ext/date (#17890) 2025-03-02 22:55:06 +01:00
Niels Dossche
d95b9d6d32
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17736: Assertion failure zend_reference_destroy()
2025-03-02 22:41:21 +01:00
Niels Dossche
ee4a9a4a7c
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17736: Assertion failure zend_reference_destroy()
2025-03-02 22:37:07 +01:00
Niels Dossche
ce8ab5f16a
Fix GH-17736: Assertion failure zend_reference_destroy()
The cache slot for FETCH_OBJ_W in function `test` is primed with the
class for C. The next call uses a simplexml instance and reuses the same
cache slot. simplexml's get_property_ptr handler does not use the cache
slot, so the old values remain in the cache slot. When
`zend_handle_fetch_obj_flags` is called this is not guarded by a check
for the class entry. So we end up using the prop_info from the property
C::$a instead of the simplexml property.

This patch adds a reset to the cache slots in the property address fetch
code and also in the extensions with a non-standard reference handler.
This keeps the run time cache consistent and avoids the issue without
complicating the fast paths.

Closes GH-17739.
2025-03-02 22:33:32 +01:00
Calvin Buckley
3677871347
Use pkg-config for ext/ldap without a directory (#17441)
* Use pkg-config for ext/ldap without a directory

The existing check is not very good. OpenLDAP has been shipping a
pkg-config file for a while now, and that's preferable over trying to
manually find it.

Note that for older OpenLDAP or non-OpenLDAP implementations, a
directory can still be passed to use the old logic. Note that Oracle
LDAP is busted and going away soon; I'm not sure for other LDAP
implementations.

Tested on macOS 14.

* Convert added ifs to AS_IF
2025-02-28 14:39:31 -04:00
Jakub Zelenka
2e7b6dac31
Merge branch 'PHP-8.4' 2025-02-28 14:52:37 +01:00
Jakub Zelenka
4936c32772
Merge branch 'PHP-8.3' into PHP-8.4 2025-02-28 14:51:52 +01:00
Jakub Zelenka
6bb56fe0cf
Change openssl_x509_verify test to use cert generator (#17882)
This also prevents verifying cert with SHA1 signature
2025-02-28 14:51:12 +01:00
Niels Dossche
422e90db3b
Fix branch target in zend_jit_push_call_frame() (#17949)
Introduced by accident in 3b4a58da44.
Will request a cherry-pick.
2025-02-28 09:20:02 +01:00
Tim Düsterhus
da1e254652
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix `ReflectionFunction::isDeprecated()` for materialized `__call()` (#17914)
2025-02-27 14:48:24 +01:00
Tim Düsterhus
2e999bad34
Fix ReflectionFunction::isDeprecated() for materialized __call() (#17914)
* Fix `ReflectionFunction::isDeprecated()` for materialized `__call()`

Fixes php/php-src#17913

* NEWS
2025-02-27 14:48:08 +01:00
Art Kay
2b2a70d45e
Fix a number of typos in comments / docs
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>

Closes GH-17874
2025-02-26 22:57:31 +01:00
Ilija Tovilo
8f21763616
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix varying pgsql error message
2025-02-26 21:30:32 +01:00
Ilija Tovilo
8be263d2a1
Fix varying pgsql error message 2025-02-26 21:30:24 +01:00
David Carlier
d6cd754121
Merge branch 'PHP-8.4' 2025-02-25 21:56:01 +00:00
David Carlier
c8bead8393
Merge branch 'PHP-8.3' into PHP-8.4 2025-02-25 21:55:46 +00:00
David Carlier
8cbc0c57b7
Fix GH-17921 socket_read/socket_recv overflows on buffer size.
update the existing checks to be more straightforward instead of
counting on undefined behavior.

close GH-17923
2025-02-25 21:54:24 +00:00
Ilija Tovilo
ded8af57c4
Merge branch 'PHP-8.4'
* PHP-8.4:
  Reflection: indicate final and abstract properties in string output
2025-02-25 12:22:00 +01:00
Daniel Scherzer
81f143e71f
Reflection: indicate final and abstract properties in string output
Add "final" and "abstract" to the result of `_property_string()` when
outputting the string representation of a `ReflectionClass` or
`ReflectionProperty` instance

Closes GH-17827
2025-02-25 12:21:15 +01:00
David CARLIER
cc116067b2
Revert "ext/sockets: follow-up on AF_PACKET support." (#17924)
This reverts commit de018aa2c5.
2025-02-25 07:04:40 +00:00
Dmitry Stogov
1a10b990f2
Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-02-25 02:23:57 +03:00
Dmitry Stogov
819b1988a0
Update IR
IR commit: ca93e781eaf6b0949690d3df272ecf44528ff4a8
2025-02-25 02:23:05 +03:00
Jakub Zelenka
9ed83e1c74
Merge branch 'PHP-8.4' 2025-02-24 23:23:25 +01:00
Jakub Zelenka
ed00c1d74b
Merge branch 'PHP-8.3' into PHP-8.4 2025-02-24 23:22:47 +01:00
Jakub Zelenka
930624899b
Fix bug #72666: stat cache not cleared for plain paths
This adds more aggressive clearing of stat cache. It is added to the
filestat as well as plain wrapper operations which covers stream file
accessing as well as exec functions (using pipes). It should hopefully
fix the most visible issues with the stat cache.

Closes GH-17681
2025-02-24 23:21:45 +01:00
David Carlier
de018aa2c5
ext/sockets: follow-up on AF_PACKET support.
support from socket_recvfrom and exposing basic PHP userland type.

close GH-17657
2025-02-24 22:09:29 +00:00
Niels Dossche
3b4a58da44
Backport GH-17869 to PHP 8.3 JIT
Closes GH-17918.
2025-02-24 21:45:03 +01:00
Niels Dossche
8e9df32309
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17868: Cannot allocate memory with tracing JIT on 8.4.4
2025-02-24 19:39:00 +01:00
Niels Dossche
5ede5415e1
Fix GH-17868: Cannot allocate memory with tracing JIT on 8.4.4
The generated code tries to initialize the run time cache for even
internal closures, but it should only initialize the run time cache for
user closures. We fix this by adding a check for the function type.
If `func` is known, then we can check the type at code generation time.

Closes GH-17869.
2025-02-24 19:36:13 +01:00
Niels Dossche
2b6c9b68bb
Fix GH-17900 and GH-8084
Calling the constructor twice has no real world benefit.
Block it to fix these two issues.
We also clean up the constructor code a bit:
- `in_ctor` implies `object` exist.
- We surround the instance check with ZEND_DEBUG to avoid a runtime
  penalty.

Closes GH-17900.
Closes GH-8084.
Closes GH-17908.
2025-02-24 19:25:08 +01:00
Bob Weinand
bcd7222522 Merge branch 'PHP-8.4' 2025-02-24 14:37:21 +01:00
Bob Weinand
53fa98ecd3
Fix GH-17715: Handle preloaded internal function runtime cache (#17835)
This solely affects the builtin enum functions currently.

Given that these are stored in SHM, we cannot simply hardwire a pointer into the internal function runtime cache on NTS too, but have to use a MAP_PTR (like on ZTS).
Now, by design, the runtime cache of internal functions no longer is reset between requests, hence we need to store them explicitly as static runtime cache.

On NTS builds we cannot trivially move the pointers into CG(internal_run_time_cache) as they're directly stored on the individual functions (on ZTS we could simply iterate the static map_ptrs).
Hence, we have the choice between having opcache managing the internal run_time_cache for its preloaded functions itself or realloc CG(internal_run_time_cache) and iterate through all functions to assign the new address. We choose the latter for simplicity and initial speed.
2025-02-24 14:35:47 +01:00
David Carlier
06101224b4
Merge branch 'PHP-8.4' 2025-02-24 07:15:08 +00:00
David Carlier
fc73da57f4
Merge branch 'PHP-8.3' into PHP-8.4 2025-02-24 07:14:56 +00:00
Michael Orlitzky
174a7fe6f9
Fix GH-17891 gh17373.phpt test issue without freetype support
skip if imagefttext() is not available

This test calls imagefttext(), which may not be available if libgd
was built without freetype support.

Closes GH-17910
2025-02-24 07:13:11 +00:00
Niels Dossche
1fa15abe92
Remove pointless call to zval_ptr_dtor() in sqlite3 (#17906)
This is IS_LONG.
2025-02-23 21:04:47 +01:00
Michael Orlitzky
065b4ec125
ext/gd/tests: backport optional PNG support
- Three of our gd tests could be skipped with a message about requiring
bundled GD, but those tests don't actually require bundled GD. We
update the messages to mention the specific functions that are
required.

- add SKIPIF stanzas for missing PNG support

The bundled libgd always has PNG support, but an external one may not.

- imagerotate() is always available

Following 59ec80c5, the imagerotate() function is always available. We
may therefore remove its function_exists() checks without harm.

close GH-17894
2025-02-23 16:01:30 +00:00
Niels Dossche
6a4b0c922c
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix memory leaks in pdo_sqlite callback registration
  Fix cycle leak in sqlite3 setAuthorizer()
2025-02-23 16:36:06 +01:00