From fd2e1086c69e2c4c237e8ceab06f8948983bbb17 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 10 Dec 2015 14:05:27 +0100 Subject: [PATCH] dont return an owner for files that don't exist --- lib/private/files/view.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 357f854e5e..6bc1ac46ef 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(); } /**