[php-src] master: Merge branch 'PHP-8.6'
| From: | Jakub Zelenka | Date: | Tue, 22 Sep 2026 14:33:58 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.6' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141427@lists.php.net to get a copy of this message | ||
Author: Jakub Zelenka (bukka)
Date: 2026-09-22T16:33:45+02:00
Commit: https://github.com/php/php-src/commit/bc1391da9636e1e7ee379ce6e7b6062b1dd64b77
Raw diff: https://github.com/php/php-src/commit/bc1391da9636e1e7ee379ce6e7b6062b1dd64b77.diff
Merge branch 'PHP-8.6'
* PHP-8.6:
fix windows ci: w11 no longer treats names like NUL.txt as reserved (#23844)
Changed paths:
M ext/standard/tests/file/ghsa-9f67-6fw4-hpfp-win32.phpt
Diff:
diff --git a/ext/standard/tests/file/ghsa-9f67-6fw4-hpfp-win32.phpt
b/ext/standard/tests/file/ghsa-9f67-6fw4-hpfp-win32.phpt
index d83260e5507e..27104f12b4a8 100644
--- a/ext/standard/tests/file/ghsa-9f67-6fw4-hpfp-win32.phpt
+++ b/ext/standard/tests/file/ghsa-9f67-6fw4-hpfp-win32.phpt
@@ -22,12 +22,28 @@ foreach (['NUL', 'nul:', '\\\\.\\NUL'] as $name) {
}
echo "Reserved names in paths are rejected:\n";
-foreach (['NUL', 'con', 'COM1', 'LPT9', 'CONIN$',
'NUL.txt', 'con.php', 'aux:stream', 'NUL .txt', 'NUL
:txt', '.\\NUL'] as $name) {
+foreach (['NUL', 'con', 'COM1', 'LPT9', 'CONIN$',
'.\\NUL'] as $name) {
$blocked = $dir . DIRECTORY_SEPARATOR . $name;
var_dump(@fopen($blocked, 'wb') === false);
var_dump(file_exists($blocked));
}
-var_dump(@fopen('NUL.txt', 'wb') === false);
+
+echo "Suffixed device names:\n";
+foreach (['NUL.txt', 'con.php', 'aux:stream', 'NUL .txt',
'NUL :txt'] as $name) {
+ $file = $dir . DIRECTORY_SEPARATOR . $name;
+ $h = @fopen($file, 'wb');
+ if (PHP_WINDOWS_VERSION_BUILD < 22000) {
+ var_dump($h === false);
+ } else {
+ // Windows 11 treats these as regular files
+ var_dump(is_resource($h) && (fstat($h)['mode'] & 0170000) ===
0100000);
+ fclose($h);
+ // Delete the base file and its streams
+ $base = $dir . DIRECTORY_SEPARATOR . explode(':', $name)[0];
+ unlink('\\\\.\\' . $base . '::$DATA');
+ }
+ var_dump(file_exists($file));
+}
var_dump(@stat($dir . DIRECTORY_SEPARATOR . 'NUL') === false);
var_dump(@mkdir($dir . DIRECTORY_SEPARATOR . 'NUL') === false);
var_dump(@rename(__FILE__, $dir . DIRECTORY_SEPARATOR . 'PRN') === false);
@@ -61,6 +77,7 @@ bool(true)
bool(false)
bool(true)
bool(false)
+Suffixed device names:
bool(true)
bool(false)
bool(true)
@@ -75,7 +92,6 @@ bool(true)
bool(true)
bool(true)
bool(true)
-bool(true)
Similar names are fine:
bool(true)
bool(true)