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

17918 Commits

Author SHA1 Message Date
Arnaud Le Blanc
5485f8ee40 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20875: Propagate IN_GET guard in get_property_ptr_ptr for lazy proxies
2026-03-20 15:45:42 +01:00
Ilia Alshanetsky
9ec303edde Fix GH-20875: Propagate IN_GET guard in get_property_ptr_ptr for lazy proxies
zend_std_get_property_ptr_ptr() was the only property handler that did
not propagate the IN_GET guard to the underlying object when forwarding
from a lazy proxy after initialization. This caused __get to be called
on the underlying object when it shouldn't be, leading to assertion
failures.

The same guard-copying pattern already existed in read_property,
write_property, unset_property, and has_property since commit
26f5009e91 (GH-18039).

Also fixes GH-20873 and GH-20854.

Closes GH-20875
2026-03-20 15:44:21 +01:00
ndossche
cefdfc9f5c Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [ci skip] Update JIT news
2026-03-17 08:53:41 +01:00
ndossche
ae863ea4f8 [ci skip] Update JIT news
Closes GH-21395.
2026-03-17 08:53:10 +01:00
ndossche
c9a6743b59 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21454: Missing write lock validation in SplHeap
2026-03-17 08:47:46 +01:00
ndossche
8796d75365 Fix GH-21454: Missing write lock validation in SplHeap
Closes GH-21448.
2026-03-17 08:47:20 +01:00
David Carlier
277a016723 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/gd: phpinfo() to be able to display libjpeg 10.0 support.
2026-03-14 18:24:17 +00:00
David Carlier
e257c086bb ext/gd: phpinfo() to be able to display libjpeg 10.0 support.
Fix #21431

Co-Authored-By: rainerjung

close GH-21432
2026-03-14 18:23:35 +00:00
ndossche
ed3eb8519a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [ci skip] NEWS for GH-20838
2026-03-12 22:04:32 +01:00
ndossche
9150226166 [ci skip] NEWS for GH-20838 2026-03-12 22:04:08 +01:00
ndossche
757dadcf1f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21083: Skip private_key_bits validation for EC/curve-based keys
2026-03-12 22:01:21 +01:00
Ilia Alshanetsky
7950482562 Fix GH-21083: Skip private_key_bits validation for EC/curve-based keys
openssl_pkey_new() checks private_key_bits >= 384 before generating any
key. For EC, X25519, ED25519, X448, and ED448 the size is inherent to
the curve or algorithm, so this check doesn't apply and causes failures
when default_bits is missing from openssl.cnf (which is the case in
OpenSSL 3.6's default config).

Skip the minimum-bits check for key types that don't use private_key_bits.

Closes GH-21387.
2026-03-12 21:53:22 +01:00
ndossche
a3f486dfa3 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21357: XSLTProcessor works with DOMDocument, but fails with Dom\XMLDocument
2026-03-11 22:31:33 +01:00
ndossche
284fd7779d Fix GH-21357: XSLTProcessor works with DOMDocument, but fails with Dom\XMLDocument
Registering namespace after the parsing is too late because parsing can
fail due to attributes referencing namespaces.
So we have to register fake namespaces before the parsing.
However, the clone operation reconciles namespaces in the wrong way, so
we have to clone via an object.

Closes GH-21371.
2026-03-11 22:31:03 +01:00
David Carlier
f04873c1b8 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/soap: Fix wrong cookie options offset calculation, using separator offset instead.
2026-03-10 21:59:38 +00:00
David Carlier
1b61d555fb ext/soap: Fix wrong cookie options offset calculation, using separator offset instead.
The cookie option parser uses a wrong offset to start scanning
attributes, causing cookie values containing substrings like
"path=" or "domain=" to be falsely matched as attributes.

close GH-21400
2026-03-10 21:58:52 +00:00
ndossche
14f0f8650c Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix memory leak in shm_get_var() when variable is corrupted
2026-03-10 20:30:31 +01:00
ndossche
ea8aab9220 Fix memory leak in shm_get_var() when variable is corrupted
This path wasn't tested (clearly).
To trigger this we use FFI, which seemed like the easiest way that
doesn't involve using another process messing with the shared memory.

Closes GH-21388.
2026-03-10 20:30:02 +01:00
ndossche
3b8aac8dad Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Revert "ext/session: Fix memory leak due to multiple exception happening during session abort"
2026-03-10 20:29:08 +01:00
ndossche
3073948885 Revert "ext/session: Fix memory leak due to multiple exception happening during session abort"
This reverts commit 0acde11945.

The patch is incorrect as described in GH-21200 in the post-merge
comments.
2026-03-10 20:28:47 +01:00
Calvin Buckley
06f9389d69 Update NEWS for pcntl fix [skip ci] 2026-03-09 14:31:20 -03:00
Ilija Tovilo
ff3f59b5a7 Fix incorrect property_info sizing for locally shadowed trait properties
Previously, static trait properties would always redeclare locally declared
static properties to make sure any inherited property would stop sharing a
common slot with the parent. This would leave holes in property_info, creating
issues for this code:

    zend_hash_extend(&ce->properties_info,
        zend_hash_num_elements(&ce->properties_info) +
        zend_hash_num_elements(&parent_ce->properties_info), 0);

where zend_hash_num_elements(&ce->properties_info) +
zend_hash_num_elements(&parent_ce->properties_info) is supposed to extend the
hash table enough to hold all additional properties coming from parent. However,
if ce->properties_info contains holes this might not be enough, given all parent
properties are appended at nNumUsed.

This could be fixed by further extending the hash table, but we can also avoid
the holes in properties_info completely by not redeclaring trait properties that
are already declared in the target class. This is now possible because traits
are bound before performing parent class inheritance, so if the property is
already present we know it will separate the property slot.

Fixes GH-20672
Closes GH-21358
2026-03-09 13:50:27 +01:00
武田 憲太郎
35d98cb6ce ext/pgsql: Fix preprocessor guard typo that silently disabled a feature
Fix `PQTRACE_SUPPRESS_TIMESTAMPS` guard misspelling in pgsql.stub.php.

The guard has been misspelled as `PQTRACE_SUPPPRESS_TIMESTAMPS`
(three P's) since 7ec8ae12c4, preventing the
`PGSQL_TRACE_SUPPRESS_TIMESTAMPS` constant from being registered.

close GH-21386
2026-03-09 07:41:04 +00:00
Gina Peter Banyard
10e02b0a4a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/session: Fix memory leak due to multiple exception happening during session abort
2026-03-07 13:30:15 +00:00
Gina Peter Banyard
0acde11945 ext/session: Fix memory leak due to multiple exception happening during session abort
Closes GH-21200

Co-authored-by: arshidkv12 <arshidkv12@gmail.com>
2026-03-07 13:28:42 +00:00
ndossche
37fbbbc4d3 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update ext/standard/libavifinfo
2026-03-07 11:18:29 +01:00
Yannis
c3777c73b3 Update ext/standard/libavifinfo
Fixes GH-20627.
Closes GH-21250.
2026-03-07 11:17:56 +01:00
David Carlier
449361afbf Fix GH-21333: use-after-free when unlinking entries during iteration of a compressed phar.
close GH-21334
2026-03-05 22:31:49 +00:00
David Carlier
d08d80cf02 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21336: undefined behavior in snmp setSecurity.
2026-03-05 18:51:23 +00:00
David Carlier
41458c6ad6 Fix GH-21336: undefined behavior in snmp setSecurity.
close GH-21337
2026-03-05 18:48:39 +00:00
ndossche
9248a6c70e Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  bz2: Fix truncation of total output size causing erroneous errors
2026-02-27 23:47:13 +01:00
Niels Dossche
4ee95fc2f3 bz2: Fix truncation of total output size causing erroneous errors
Also switch to uint64_t as that's used on master and makes the code
simpler to fix.

Closes GH-20807.

Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2026-02-27 23:46:48 +01:00
David Carlier
7a8a8633ce Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcre: fix mdata_used race conditions in PCRE functions
2026-02-27 22:15:02 +00:00
David Carlier
f8114f554c ext/pcre: fix mdata_used race conditions in PCRE functions
Mirror the mdata_used protection pattern from php_pcre_replace_func_impl
in php_pcre_match_impl, php_pcre_replace_impl, php_pcre_split_impl,
and php_pcre_grep_impl.

close GH-21291
2026-02-27 22:14:41 +00:00
ndossche
38421684c1 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20906: Assertion failure when messing up output buffers
2026-02-27 18:15:20 +01:00
ndossche
1709689256 Fix GH-20906: Assertion failure when messing up output buffers
Closes GH-20908.
2026-02-27 18:14:56 +01:00
David Carlier
78702fa470 ext/pcre: fix memory leaks on error paths
Fix pcre2_code leak when pcre2_pattern_info() fails after a successful
pcre2_compile(), and fix match_sets/match_data/marks leak when
offsets[1] < offsets[0] in php_pcre_match_impl().

close GH-21298
2026-02-26 18:56:24 +00:00
Calvin Buckley
9942f063db PHP-8.4 is now for PHP 8.4.20-dev 2026-02-24 17:50:02 -05:00
David Carlier
6c45f7a000 ext/pcre: preg_match() fix memory leak with invalid regexes.
close GH-21290
2026-02-24 22:19:27 +00:00
Ilija Tovilo
8206eb1cb4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix preloaded constant erroneously propagated to file-cached script
2026-02-24 17:30:14 +01:00
Ilija Tovilo
ec5a1e001d Fix preloaded constant erroneously propagated to file-cached script
Since GH-15021 preloaded constants are propagated to compiled scripts. This is
problematic for file cache, which assumes all referenced zvals are either
persistently allocated or local to the current script. However, preloaded
constants live in shm as immutable, but not persistent.

To solve this, we'd need to duplicate propagated constants in the optimizer when
file cache is used. This is error prone given it needs to happen in many places.
It's debatable whether constant propagation is even correct in this case, as
running the preloaded script on a restart isn't guaranteed to produce the same
result.

Hence, avoid the issue for now by just not relying on preloaded symbols when
file cache is used.

Fixes GH-21052
Closes GH-21281
2026-02-24 17:28:56 +01:00
Daniel Scherzer
ee1e5f295d PHP-8.5 is now for PHP 8.5.5-dev 2026-02-24 11:10:09 -05:00
David Carlier
296fad10fb ext/pcntl: fix pcntl_signal_dispatch() stale tail pointer and exception handling.
close GH-21259
2026-02-23 21:24:38 +00:00
David Carlier
aa44392dfc Fix GH-21262: ldap_modify() too strict controls argument validation.
make it impossible to unset an attribute.

close GH-21263
2026-02-23 20:46:04 +00:00
Peter Kokot
c89b363fc9 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  sapi/*/Makefile.frag: install programs built with libtool, with libtool
2026-02-23 17:20:59 +01:00
Michael Orlitzky
db6cca26dd sapi/*/Makefile.frag: install programs built with libtool, with libtool
When installing executables that were built using libtool, we are
supposed to use

  $ libtool --mode-install <install-command>

rather than the bare <install-command>. This is discussed ever so
briefly in the "Installing executables" section of the GNU libtool
documentation:

  https://www.gnu.org/software/libtool/manual/libtool.html

So far this has not caused a problem with GNU libtool on the platforms
that PHP supports, but there is an alternate libtool implementation
called slibtool that stores wrappers at the locations where PHP is
expecting the true executables to live. As a result, the wrappers (and
not the executables) are installed when slibtool is used to build PHP.

This is fixed by replacing,

  $(INSTALL)

with

  $(LIBTOOL) --mode=install $(INSTALL)

in the install-foo rules for the executables that are built with
libtool.

Closes GH-13674
2026-02-23 17:19:23 +01:00
David Carlier
6a1bde5d38 ext/pcntl: Fix signal table updated before php_signal4 succeeds in pcntl_signal
Move the signal table update after the php_signal4 call, mirroring
what is already done in the SIG_DFL/SIG_IGN (integer) code path.
This prevents a stale entry in the table if sigaction fails.

close GH-21270
2026-02-23 12:47:55 +00:00
David Carlier
37ce67f276 ext/pcntl: Fix cpuset leak in pcntl_setcpuaffinity on out-of-range CPU ID
Add missing PCNTL_CPU_DESTROY(mask) call before RETURN_THROWS() when
the cpu id is out of range, matching the cleanup on other error paths.

close GH-21268
2026-02-22 19:57:19 +00:00
David Carlier
e2a5909ba3 ext/pcntl: fix pcntl_setns() error handling.
Save errno into a local int before calling close(fd), as close() may
clobber errno on failure. Use int rather than errno_t because errno_t
is defined in C11 Annex K (bounds-checking interfaces) which is
optional and not widely implemented — many platforms (Linux/glibc,
musl, macOS, FreeBSD) do not provide it.

close GH-21256
2026-02-22 19:05:55 +00:00
Ayesh Karunaratne
9c615fb06b NEWS: fix minor formatting [skip-ci] 2026-02-19 14:21:58 +05:30