From d32996a0d5e4e445d55e66e93451cf8fb3b53514 Mon Sep 17 00:00:00 2001 From: Karson Date: Thu, 10 Jul 2025 10:05:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B9=B6=E5=8F=91=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E7=9B=AE=E5=BD=95=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/File.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/library/think/File.php b/library/think/File.php index d2ed2208..052f4d19 100644 --- a/library/think/File.php +++ b/library/think/File.php @@ -150,12 +150,19 @@ class File extends SplFileObject */ protected function checkPath($path) { - if (is_dir($path) || mkdir($path, 0755, true)) { + if (is_dir($path)) { + return true; + } + + if (@mkdir($path, 0755, true)) { + return true; + } + + if (is_dir($path)) { return true; } $this->error = ['directory {:path} creation failed', ['path' => $path]]; - return false; }