summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-11-25 12:16:54 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2019-12-02 11:29:10 +0100
commitbb735c9e9e4a2ca2686a141ffe867f60ee0053c3 (patch)
treeebc32df4cc290d5047213a8a5ad8e3ede3a82631 /ext
parent3d81c548796b549195be6f8d1e213dcd42802e09 (diff)
downloadphp-git-bb735c9e9e4a2ca2686a141ffe867f60ee0053c3.tar.gz
Fix #78296: is_file fails to detect file
If we're constructing extended-length paths (i.e. paths prefixed with `\\?\`), we have to replace all forward slashes with backward slashes, because the former are not supported by Windows for extended-length paths. The more efficient and likely cleaner alternative solution would be to cater to this in `php_win32_ioutil_normalize_path_w()` by always replacing forward slashes, but that might break existing code. It might be sensible to change that for `master`, though.
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/tests/file/bug78296.phpt16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/standard/tests/file/bug78296.phpt b/ext/standard/tests/file/bug78296.phpt
new file mode 100644
index 0000000000..e7388d51b7
--- /dev/null
+++ b/ext/standard/tests/file/bug78296.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #78296 (is_file fails to detect file)
+--FILE--
+<?php
+$dir = str_pad(__DIR__ . '/bug78296', 250, '_');
+var_dump(mkdir($dir));
+var_dump(is_dir($dir));
+?>
+--EXPECT--
+bool(true)
+bool(true)
+--CLEAN--
+<?php
+$dir = str_pad(__DIR__ . '/bug78296', 250, '_');
+rmdir($dir);
+?>