Fix check for parentDir and fix the return for a nonexistent target in the database
This commit is contained in:
parent
053edde780
commit
b03083b881
1 changed files with 7 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue