From db2b22c822dcd63b6025f5ceebd6d38c3be531cd Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 27 Aug 2022 20:03:22 +0800 Subject: [PATCH] FileSystem.php isRelativePath() compatibility for windows --- src/ZM/Store/FileSystem.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ZM/Store/FileSystem.php b/src/ZM/Store/FileSystem.php index 9972aa51..cdb0f953 100644 --- a/src/ZM/Store/FileSystem.php +++ b/src/ZM/Store/FileSystem.php @@ -70,6 +70,10 @@ class FileSystem */ public static function isRelativePath(string $path): bool { + // 适配 Windows 的多盘符目录形式 + if (DIRECTORY_SEPARATOR === '\\') { + return strlen($path) > 2 && ctype_alpha($path[0]) && $path[1] === ':'; + } return strlen($path) > 0 && $path[0] !== '/'; }