From b03083b881ed48681b3977ec069a596f72af4573 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Mon, 27 Jun 2011 18:14:04 -0400 Subject: [PATCH] Fix check for parentDir and fix the return for a nonexistent target in the database --- apps/files_sharing/lib_share.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index e64fed6f64..a2fb5161d9 100644 --- a/apps/files_sharing/lib_share.php +++ b/apps/files_sharing/lib_share.php @@ -87,11 +87,15 @@ class OC_SHARE { if (count($result) > 0) { return $result[0]['source']; } else { - // Check if the directory above this target is shared + // Check if the parent directory of this target is shared $parentDir = dirname($target); - if ($parentDir) { + if ($parentDir != ".") { $result = OC_SHARE::getSource($parentDir); - return $result."/".basename($target); + if ($result) { + return $result."/".basename($target); + } else { + return false; + } } else { return false; }