Skip to content

Commit 800d837

Browse files
authored
Merge branch 'php:master' into master
2 parents e417dc9 + c4105b6 commit 800d837

19 files changed

Lines changed: 343 additions & 56 deletions

File tree

.github/actions/setup-windows/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ runs:
1616
- name: Setup PostgreSQL
1717
shell: pwsh
1818
run: |
19-
Set-Service -Name "postgresql-x64-14" -StartupType manual -Status Running
19+
$postgresService = if ($env:PHP_BUILD_CRT -eq "vs18") { "postgresql-x64-17" } else { "postgresql-x64-14" }
20+
Set-Service -Name $postgresService -StartupType manual -Status Running
2021
pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "ALTER USER postgres WITH PASSWORD 'Password12!';" }

.github/matrix.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re
153153
}
154154
}
155155
$jobs['WINDOWS']['matrix'] = ['include' => $matrix];
156-
$jobs['WINDOWS']['config'] = version_compare($php_version, '8.4', '>=')
157-
? ['vs_crt_version' => 'vs17']
158-
: ['vs_crt_version' => 'vs16'];
156+
$jobs['WINDOWS']['config'] = match (true) {
157+
version_compare($php_version, '8.6', '>=') => ['vs_crt_version' => 'vs18', 'runs_on' => 'windows-2025-vs2026'],
158+
version_compare($php_version, '8.4', '>=') => ['vs_crt_version' => 'vs17', 'runs_on' => 'windows-2022'],
159+
default => ['vs_crt_version' => 'vs16', 'runs_on' => 'windows-2022'],
160+
};
159161
}
160162
if ($all_jobs || !$no_jobs || $test_freebsd) {
161163
$jobs['FREEBSD']['matrix'] = $all_variations && version_compare($php_version, '8.3', '>=')

.github/scripts/windows/find-vs-toolset.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
setlocal enabledelayedexpansion
44

55
if "%~1"=="" (
6-
echo ERROR: Usage: %~nx0 [vc14^|vc15^|vs16^|vs17]
6+
echo ERROR: Usage: %~nx0 [vc14^|vc15^|vs16^|vs17^|vs18]
77
exit /b 1
88
)
99

1010
set "toolsets_vc14=14.0"
1111
set "toolsets_vc15="
1212
set "toolsets_vs16="
1313
set "toolsets_vs17="
14+
set "toolsets_vs18="
1415

1516

1617
for /f "usebackq tokens=*" %%I in (`vswhere.exe -latest -find "VC\Tools\MSVC"`) do set "MSVCDIR=%%I"
@@ -30,8 +31,10 @@ for /f "delims=" %%D in ('dir /b /ad "%MSVCDIR%"') do (
3031
set "toolsets_vc15=%%D"
3132
) else if !min! LEQ 29 (
3233
set "toolsets_vs16=%%D"
33-
) else (
34+
) else if !min! LEQ 49 (
3435
set "toolsets_vs17=%%D"
36+
) else (
37+
set "toolsets_vs18=%%D"
3538
)
3639
)
3740
)

.github/workflows/test-suite.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,12 +941,12 @@ jobs:
941941
fail-fast: false
942942
matrix: ${{ fromJson(inputs.branch).jobs.WINDOWS.matrix }}
943943
name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || ''}}${{ matrix.clang && '_CLANG' || ''}}"
944-
runs-on: windows-2022
944+
runs-on: ${{ fromJson(inputs.branch).jobs.WINDOWS.config.runs_on }}
945945
env:
946946
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
947947
PHP_BUILD_OBJ_DIR: C:\obj
948948
PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk
949-
PHP_BUILD_SDK_BRANCH: php-sdk-2.5.0
949+
PHP_BUILD_SDK_BRANCH: php-sdk-2.7.1
950950
PHP_BUILD_CRT: ${{ fromJson(inputs.branch).jobs.WINDOWS.config.vs_crt_version }}
951951
PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }}
952952
THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}"

SECURITY.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,29 @@ Vulnerability reports remain private until published. When published, you will
1111
be credited as a contributor, and your contribution will reflect the MITRE
1212
Credit System.
1313

14+
# Classification
15+
16+
Issues commonly reported that are _not_ considered security issues include (but
17+
are not limited to):
18+
19+
- Invocation of specially crafted, malicious code intended to cause memory
20+
violations. This commonly includes malicious error handlers, destructors or
21+
`__toString()` functions. PHP does not offer sandboxing, and the execution of
22+
untrusted code is always considered unsafe. Such issues are bugs, but not
23+
security issues. They may still be reported, though please avoid reporting
24+
the known issues.
25+
26+
- Passing malicious arguments to functions clearly not intended to receive
27+
unsanitized values, e.g. `mysqli_query()`. `escapeshellarg()` on the other
28+
hand should clearly be hardened against unsafe inputs.
29+
30+
- The use of legacy APIs or settings known to be insecure, particularly those
31+
documented as such, or those with a secure alternative.
32+
33+
- The use of FFI.
34+
35+
- `open_basedir` or `disable_functions` bypasses.
36+
1437
# Vulnerability Policy
1538

1639
Our full policy is described at

Zend/Optimizer/zend_optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ zend_function *zend_optimizer_get_called_func(
943943
if (ce) {
944944
zend_string *func_name = Z_STR_P(CRT_CONSTANT(opline->op2) + 1);
945945
zend_function *fbc = zend_hash_find_ptr(&ce->function_table, func_name);
946-
if (fbc) {
946+
if (fbc && !(fbc->common.fn_flags & ZEND_ACC_ABSTRACT)) {
947947
bool is_public = (fbc->common.fn_flags & ZEND_ACC_PUBLIC) != 0;
948948
bool same_scope = fbc->common.scope == op_array->scope;
949949
if (is_public || same_scope) {

Zend/zend_vm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void zend_vm_init(void);
4040
void zend_vm_dtor(void);
4141

4242
#if ZEND_VM_KIND == ZEND_VM_KIND_TAILCALL
43-
const struct _zend_op *zend_vm_handle_interrupt(struct _zend_execute_data *execute_data, const struct _zend_op *opline);
43+
const struct _zend_op *ZEND_FASTCALL zend_vm_handle_interrupt(struct _zend_execute_data *execute_data, const struct _zend_op *opline);
4444
#endif
4545

4646
END_EXTERN_C()

ext/com_dotnet/tests/variants.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ foreach ($values as $t => $val) {
4343

4444
echo "OK!";
4545
?>
46-
--EXPECT--
46+
--EXPECTF--
4747
--
4848
add: 84
4949
cat: 4242
@@ -142,8 +142,8 @@ mul: 0
142142
and: 0
143143
div:
144144
variant_div(42, )
145-
exception Division by zero
146-
code 80020012
145+
exception %s
146+
code 800200%x
147147

148148
eqv: -43
149149
idiv:
@@ -258,8 +258,8 @@ mul: 0
258258
and: 0
259259
div:
260260
variant_div(3.5, )
261-
exception Division by zero
262-
code 80020012
261+
exception %s
262+
code 800200%x
263263

264264
eqv: -5
265265
idiv:

ext/curl/config.w32

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,18 @@ if (PHP_CURL != "no") {
1212
SETUP_ZLIB_LIB("curl", PHP_CURL) &&
1313
(CHECK_LIB("normaliz.lib", "curl", PHP_CURL) &&
1414
CHECK_LIB("libssh2.lib", "curl", PHP_CURL) &&
15-
CHECK_LIB("nghttp2.lib", "curl", PHP_CURL) &&
16-
CHECK_LIB("brotlidec.lib", "curl", PHP_CURL) &&
17-
CHECK_LIB("brotlicommon.lib", "curl", PHP_CURL) &&
18-
CHECK_LIB("libzstd.lib", "curl", PHP_CURL))
15+
CHECK_LIB("nghttp2.lib", "curl", PHP_CURL))
1916
) {
17+
if (!(CHECK_HEADER_ADD_INCLUDE("brotli/decode.h", "CFLAGS_CURL") &&
18+
CHECK_LIB("brotlidec.lib;brotlidec-static.lib", "curl", PHP_CURL) &&
19+
CHECK_LIB("brotlicommon.lib;brotlicommon-static.lib", "curl", PHP_CURL)
20+
)) {
21+
WARNING("brotli in curl not enabled; libraries or headers not found");
22+
}
23+
if (!(CHECK_LIB("libzstd.lib;libzstd_a.lib", "curl", PHP_CURL)
24+
)) {
25+
WARNING("zstd in curl not enabled; library not found");
26+
}
2027
EXTENSION("curl", "interface.c multi.c share.c curl_file.c");
2128
AC_DEFINE('HAVE_CURL', 1, "Define to 1 if the PHP extension 'curl' is available.");
2229
ADD_FLAG("CFLAGS_CURL", "/D PHP_CURL_EXPORTS=1");

ext/intl/calendar/calendar_methods.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static void _php_intlcal_before_after(
373373

374374
when_co = Z_INTL_CALENDAR_P(when_object);
375375
if (when_co->ucal == NULL) {
376-
zend_argument_error(NULL, 2, "is uninitialized");
376+
zend_argument_error(NULL, hasThis() ? 1 : 2, "is uninitialized");
377377
RETURN_THROWS();
378378
}
379379

@@ -796,7 +796,7 @@ U_CFUNC PHP_FUNCTION(intlcal_is_equivalent_to)
796796

797797
other_co = Z_INTL_CALENDAR_P(other_object);
798798
if (other_co->ucal == NULL) {
799-
zend_argument_error(NULL, 2, "is uninitialized");
799+
zend_argument_error(NULL, hasThis() ? 1 : 2, "is uninitialized");
800800
RETURN_THROWS();
801801
}
802802

@@ -933,7 +933,7 @@ U_CFUNC PHP_FUNCTION(intlcal_equals)
933933
CALENDAR_METHOD_FETCH_OBJECT;
934934
other_co = Z_INTL_CALENDAR_P(other_object);
935935
if (other_co->ucal == NULL) {
936-
zend_argument_error(NULL, 2, "is uninitialized");
936+
zend_argument_error(NULL, hasThis() ? 1 : 2, "is uninitialized");
937937
RETURN_THROWS();
938938
}
939939

0 commit comments

Comments
 (0)