Commit Graph
147222 Commits
Author SHA1 Message Date
Cas Ebbers ef029693db Change pcre.backtrack_limit in the ini templates to the default value (#22868) 2026-07-24 12:21:03 +02:00
Calvin Buckley 0a12b3e826 Remove param argument from php_verror (#22865)
* Remove param argument from php_verror

Now that docref has been knocked out and error_include_args exists,
remove this argument. Callers will be updated accordingly.

* Remove param from exif

* Remove param from snmp (no changes for tests needed)

* Remove param from gd (no changes for tests needed)

* Remove param from openssl

* Document param change to php_verror
2026-07-24 01:56:34 -03:00
Ilija Tovilo 1f4a88c5c3 Merge branch 'PHP-8.5'
* PHP-8.5:
  [skip ci] Revert "CI: Enable JIT testing on Apple Silicon ZTS 8.6+"
2026-07-23 21:17:51 +02:00
Ilija Tovilo 5baae3d140 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [skip ci] Revert "CI: Enable JIT testing on Apple Silicon ZTS 8.6+"
2026-07-23 21:17:45 +02:00
Ilija Tovilo b53aadea9c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Revert "CI: Enable JIT testing on Apple Silicon ZTS 8.6+"
2026-07-23 21:17:33 +02:00
Ilija Tovilo de7b4a6abd Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Revert "CI: Enable JIT testing on Apple Silicon ZTS 8.6+"
2026-07-23 21:17:13 +02:00
Ilija Tovilo bed2aa9375 [skip ci] Revert "CI: Enable JIT testing on Apple Silicon ZTS 8.6+"
This reverts commit fa47ae16a1.

On macOS in GitHub Actions, pthread_jit_write_protect_supported_np() returns
false. So, there's really no point in running JIT with it in the first place.

We'll still need to tweak some tests when they explicitly enable the JIT.
2026-07-23 21:17:02 +02:00
Calvin Buckley cdbc479b3a Merge branch 'PHP-8.5'
* PHP-8.5:
  Regenerate the expired ext/ftp/tests/cert.pem (#22873)
2026-07-23 15:10:09 -03:00
Calvin Buckley 060aee9ae2 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Regenerate the expired ext/ftp/tests/cert.pem (#22873)
2026-07-23 15:10:01 -03:00
Calvin Buckley cc92d504a4 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Regenerate the expired ext/ftp/tests/cert.pem (#22873)
2026-07-23 15:09:51 -03:00
Calvin Buckley d0f817bfd2 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Regenerate the expired ext/ftp/tests/cert.pem (#22873)
2026-07-23 15:09:40 -03:00
Ilia Alshanetsky 011ad34868 Regenerate the expired ext/ftp/tests/cert.pem (#22873)
The self-signed certificate the FTP test server presents
(ext/ftp/tests/server.inc) was generated in 2016 with a ten-year
validity and expired on 2026-07-23, so ext/ftp/tests and the ftps://
stream tests (ext/standard/tests/streams/opendir-003 and -004) fail the
TLS handshake with "certificate expired" on every branch. Regenerate it
as a self-signed CN=127.0.0.1 certificate that expires 2099-12-31, so
the suite does not silently break again on a ten-year cadence.
2026-07-23 15:08:36 -03:00
Shivam Mathur c329a71037 ext/gd: remove libde265 and x265 checks on Windows (#22869) 2026-07-23 19:32:07 +05:30
David CARLIER ea8f2cff16 ext/gd: conflicting iconv_t typedef breaking the Solaris build. (#22810)
The gd 2.4 sync guarded gdkanji.c's 'typedef void *iconv_t' fallback
with HAVE_ICONV_T_DEF, which the bundled build never defined. On
Solaris <iconv.h> declares iconv_t as a struct pointer, so it clashed.
Define HAVE_ICONV_T_DEF when <iconv.h> already provides iconv_t.
2026-07-23 12:45:38 +01:00
Ilija Tovilo 6db03786fb Merge branch 'PHP-8.5'
* PHP-8.5:
  [skip ci] Disable opcache.file_cache_only for gh22782.phpt
2026-07-23 13:34:04 +02:00
Ilija Tovilo fd9e347fb9 [skip ci] Disable opcache.file_cache_only for gh22782.phpt
Preloading is not compatible opcache.file_cache_only=0.
2026-07-23 13:27:00 +02:00
Ilija Tovilo 93e92e56c9 Merge branch 'PHP-8.5'
* PHP-8.5:
  [skip ci] Revert "CI: Revert timeout fix for Symfony community build (#22682)"
2026-07-23 13:14:14 +02:00
Ilija Tovilo e44966c08c Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [skip ci] Revert "CI: Revert timeout fix for Symfony community build (#22682)"
2026-07-23 13:14:07 +02:00
Ilija Tovilo 742ff0e42a [skip ci] Revert "CI: Revert timeout fix for Symfony community build (#22682)"
This reverts commit 841b5bfcf2.
2026-07-23 13:13:49 +02:00
Weilin Du e65a4b0f53 ext/phar: Improve various error messages (#22858)
Safe mode in phar is removed in PHP 5.4, so removing them in error messages.
Also fix some obvious typos in the error messages.
2026-07-23 18:05:22 +08:00
Alex Dowad 4983e8bb44 Merge branch 'PHP-8.5' 2026-07-23 14:54:14 +09:00
Alex Dowad e0a9940134 Merge branch 'PHP-8.4' into PHP-8.5 2026-07-23 14:53:28 +09:00
Eyüp Can Akman 0d6ab5321d Fix GH-22779: mb_strrpos() wrong result in a non-UTF-8 encoding
mb_find_strpos() converts the haystack and needle to UTF-8 and does the length and offset math on the converted strings.
The negative-offset branch computed the needle length from the raw needle instead of needle_u8.
mb_fast_strlen_utf8() reads those bytes as UTF-8, so the count is wrong whenever they do not decode one to one.
A byte in 0x80-0xBF (ISO-8859-1) undercounts, and a wider encoding such as an ASCII needle in UTF-16 overcounts, so the reverse-search window is shifted.
Use needle_u8, the converted needle the rest of the branch already searches with.
2026-07-23 14:52:15 +09:00
Calvin Buckley 28dab5fafb Remove docref1/docref2 (#22742) 2026-07-22 17:38:11 -03:00
Jakub Zelenka ae487f4f66 Add $salt_length param to openssl_sign and openssl_verify (#20681)
This allows controlling the RSA-PSS salt length and enforcing an expected
salt length when verifying. It also adds OPENSSL_RSA_PSS_SALTLEN_* constants.
This is needed for some application. Custom TLS implementation is one example
2026-07-22 22:16:42 +02:00
Calvin Buckley 77a7d34ab2 Fix GH-22849: error_include_args=1 mishandled for include() (#22851)
include and friends aren't functions, but constructs of the engine.
Special-case them and snarf their argument for display.
2026-07-22 16:18:36 -03:00
Remi Collet b06dfa2aca Fix #22859 undefined symbol 'zip_file_set_encryption' (#22861)
Only when HAVE_ENCRYPTION is true, we can use the zip_file_set_encryption
function. This commit add a guard to the zip_file_set_encryption symbol.
2026-07-23 01:03:51 +08:00
Weilin Du 83eea87930 [skip ci] Update UPGRADING.INTERNALS for #21607 2026-07-22 22:35:44 +08:00
Arnaud Le Blanc be82abb58a Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix const expr support in preloading (#22783)
2026-07-22 09:46:48 +02:00
Arnaud Le Blanc 740d1f5750 Fix const expr support in preloading (#22783)
Preloading will try to evaluate class constants during compilation but
evaluated FCCs are objects, which can not be persisted. Apply the same fix as
for enums: Fail evaluation when compiling.

Preloading will also reset CG(map_ptr_last) after compilation, which results in
collisions if map ptrs were allocated during compilation. Move the
ZEND_MAP_PTR_NEW() to the persist phase, as a shared map ptr is not necessary
before that.

Fixes GH-22782.
2026-07-22 09:44:57 +02:00
Arnaud Le Blanc 417e3d7269 Merge branch 'PHP-8.5'
* PHP-8.5:
  Clear ZREG_TYPE_ONLY flag for in-register vars in zend_jit_snapshot_handler() (#22764)
2026-07-22 09:32:17 +02:00
Arnaud Le Blanc 853b89c092 Clear ZREG_TYPE_ONLY flag for in-register vars in zend_jit_snapshot_handler() (#22764)
Fixes GH-22763.

The reproducer triggers an assertion failure in `zend_jit_use_reg()` because a var has `jit->ra[var].ref == IR_NULL` but `jit->ra[var].flags` doesn't contain `ZREG_LOAD`.

This happens because of the following events:
 * An in-register variable is spilled to the VM stack frame by IR (IR_REG_SPILL_SPECIAL)
 * zend_jit_snapshot_handler() set the stack descriptor to .flags = ZREG_TYPE_ONLY, .reg = ZREG_NONE
 * During a subsequent call to zend_jit_snapshot_handler(), the reg is not IR_REG_SPILL_SPECIAL anymore, so .reg is set but .flags remains ZREG_TYPE_ONLY which is inconsistent
 * A side trace inherits from this stack descriptor
 * zend_jit_trace_deoptimization() doesn't set `jit->ra[var].ref` for this var because `.flags == ZREG_TYPE_ONLY`, which causes the assertion failure later

Fix by removing irrelevant flags when setting reg in zend_jit_snapshot_handler().
2026-07-22 09:31:44 +02:00
David Carlier 5ccb145042 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/dom: fix UAF when setting an attribute colliding by local name.
2026-07-22 06:50:48 +01:00
David Carlier 6e7491400a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/dom: fix UAF when setting an attribute colliding by local name.
2026-07-22 06:50:39 +01:00
David Carlier 3221a076f2 ext/dom: fix UAF when setting an attribute colliding by local name.
Fix #22447

xmlHasProp() matches an attribute by local name only, ignoring its
namespace, whereas xmlAddChild()/xmlAddPrevSibling() dedup an incoming
no-namespace attribute via xmlHasNsProp(..., NULL), which matches only
attributes with no namespace. When both a no-namespace and a namespaced
attribute share a local name, the pre-insertion check unlinked the wrong
(namespaced) attribute, leaving libxml to free the still-wrapped
no-namespace duplicate and producing a use-after-free at request
shutdown.

Use xmlHasNsProp(..., NULL) so the pre-insertion check matches libxml's
internal duplicate detection, as advised by @nwellnhof.

Close GH-22452
2026-07-22 06:50:12 +01:00
Ilija Tovilo 786e42386d [skip ci] Fix tmps count in test expectation
Variation build enables observers, which add an extra tmp.
2026-07-21 20:23:27 +02:00
Arnaud Le Blanc 6b565e0450 Merge branch 'PHP-8.5'
* PHP-8.5:
  zend_jit_resolve_tsrm_ls_cache_offsets: clobber volatile registers (#22832)
2026-07-21 19:08:50 +02:00
Arnaud Le Blanc 8c96f53d91 zend_jit_resolve_tsrm_ls_cache_offsets: clobber volatile registers (#22832) 2026-07-21 19:08:25 +02:00
Weilin Du f2b6b7fd3c ext/gmp: Fix GMP error messages using outdated parameter names (#22846)
The argument name in these error messages are different from what is claimed
in the documentation and public signatures.

Updated messages:

- gmp_root() and gmp_rootrem() now refer to argument 1 as $num instead of $a.
- gmp_random_range() now refers to argument 2 as $max instead of $maximum.
2026-07-21 19:39:06 +08:00
David Carlier f6fe838e36 ext/soap: truncate header values containing newline characters.
Commit 3dcdb9826b routed the user_agent option through a truncate-and-warn
check, but the Content-Type context option, the soapaction and the cookie
names and values reach the same request buffer unchecked, so a CR/LF in any
of them still injects arbitrary request headers.

Emit all of them through that same check. The helper now takes an explicit
length so the char* soapaction can share it.

Close GH-22781
2026-07-21 03:07:08 +01:00
Ilia Alshanetsky d0f00ccd98 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/filter: encode 0xFF in FILTER_SANITIZE_ENCODED
2026-07-20 19:32:51 -04:00
Ilia Alshanetsky 2f37579205 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/filter: encode 0xFF in FILTER_SANITIZE_ENCODED
2026-07-20 19:31:06 -04:00
Ilia Alshanetsky 56149186d8 ext/filter: encode 0xFF in FILTER_SANITIZE_ENCODED
php_filter_encode_url() initialized its 256-byte "must encode" table with
memset(tmp, 1, sizeof(tmp) - 1), leaving tmp[255] uninitialized. Whether
0xFF got percent-encoded then depended on stack garbage; valgrind reports
the read as a conditional jump on an uninitialised value. Initialize the
whole table.

Closes GH-22762
2026-07-20 19:28:50 -04:00
Khaled AlamandIlija Tovilo 63e26ab716 Add trait support for internal classes (GH-20976)
Fixes GH-20974

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2026-07-20 23:32:23 +02:00
Gina Peter Banyard 36d854783b streams: remove StreamError::$param property
It is always null
2026-07-20 20:50:13 +01:00
Gina Peter Banyard 0cf29ab058 streams: remove param field of php_stream_error_entry
It is always assigned NULL
2026-07-20 20:50:13 +01:00
Gina Peter Banyard 85fc5768d6 streams: remove parameters that always passed NULL or unused 2026-07-20 20:50:13 +01:00
Nicolas Grekas 06411654ff Skip __get() when __isset() materialised the property (GH-22181)
After __isset() returns true on ?? or empty(), re-check the property table
before calling __get(). When __isset() materialised the property (a pattern used
by lazy proxies), its value is returned directly. isset() itself is unchanged.

Fixes GH-12695
2026-07-20 21:36:50 +02:00
David Carlier ab99a29383 Zend: reset typed property default on every unserialize failure path.
GH-22263 follow-up

Close GH-22481
2026-07-20 20:32:08 +01:00
Calvin Buckley 6c988e0abb main: Add AIX to PHP_OS_FAMILY (#22834)
There are two OSes in this family: AIX itself, and IBM i PASE, which
provides an AIX syscall emulation environment. uname is different
between them (AIX/OS400).
2026-07-20 16:15:14 -03:00