From 2807c1c79eb170caab55b9d6356ebcd2972304c9 Mon Sep 17 00:00:00 2001 From: Yuanuo Date: Sat, 4 Aug 2018 14:08:59 +0800 Subject: [PATCH] =?UTF-8?q?PHP=20basename=20=E4=B8=AD=E6=96=87=E4=B9=B1?= =?UTF-8?q?=E7=A0=81=E9=97=AE=E9=A2=98=20php=20basename()=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=8E=B7=E5=8F=96=E5=B8=A6=E4=B8=AD=E6=96=87=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D(=E4=B9=B1?= =?UTF-8?q?=E7=A0=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/model/Directory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/index/model/Directory.php b/application/index/model/Directory.php index 8c6e27dd..2760168d 100644 --- a/application/index/model/Directory.php +++ b/application/index/model/Directory.php @@ -168,7 +168,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota{ $dirName = end($explode); $rootPath = rtrim($path,"/".$dirName); $rootPath = empty($rootPath) ? "/" : $rootPath; - $dirData = Db::name('folders')->where('owner',$this->uid)->where('position',dirname($path) == "\\" ?"/":dirname($path))->where("folder_name",basename($path))->find(); + $dirData = Db::name('folders')->where('owner',$this->uid)->where('position',dirname($path) == "\\" ?"/":dirname($path))->where("folder_name",getDirName($path))->find(); if(empty($dirData)){ return false; }