diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-12-10 14:05:27 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-11 11:40:58 +0100 |
commit | fd2e1086c69e2c4c237e8ceab06f8948983bbb17 (patch) | |
tree | 5ac1669fef3c18264780e336c171c97e30adf456 | |
parent | 05f9b4041942794eab74328b95bfbf04c7c9e203 (diff) | |
download | nextcloud-server-fd2e1086c69e2c4c237e8ceab06f8948983bbb17.tar.gz nextcloud-server-fd2e1086c69e2c4c237e8ceab06f8948983bbb17.zip |
dont return an owner for files that don't exist
-rw-r--r-- | lib/private/files/view.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 357f854e5e2..6bc1ac46ef3 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -1573,10 +1573,15 @@ class View { * Get the owner for a file or folder * * @param string $path - * @return string + * @return string the user id of the owner + * @throws NotFoundException */ public function getOwner($path) { - return $this->basicOperation('getOwner', $path); + $info = $this->getFileInfo($path); + if (!$info) { + throw new NotFoundException($path . 'not found while trying to get owner'); + } + return $info->getOwner()->getUID(); } /** |