diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 2dc83bdcc4..2a9fa44f78 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -253,9 +253,6 @@ class Share extends Constants { // Include owner in list of users, if requested if ($includeOwner) { $shares[] = $ownerUser; - if ($returnUserPaths) { - $sharePaths[$ownerUser] = $path; - } } if ($returnUserPaths) { @@ -283,6 +280,12 @@ class Share extends Constants { } } + if ($includeOwner) { + $sharePaths[$ownerUser] = $path; + } else { + unset($sharePaths[$ownerUser]); + } + return $sharePaths; }