diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-22 09:55:29 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-22 10:14:14 +0100 |
commit | fe08b5e9d902c9dc2891c59cf7e8d3bcb2700150 (patch) | |
tree | 0238b7705748bd4d7e7bad4d9cb384cba1fa4103 /lib | |
parent | 8a8209796d4577644228121edc2231ae027217c7 (diff) | |
download | nextcloud-server-fe08b5e9d902c9dc2891c59cf7e8d3bcb2700150.tar.gz nextcloud-server-fe08b5e9d902c9dc2891c59cf7e8d3bcb2700150.zip |
We should check for exceptions when trying to get the avatar
Fixes #22550
* Updated phpdoc of avatatmanager
* Add unit test
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/avatarmanager.php | 2 | ||||
-rw-r--r-- | lib/public/iavatarmanager.php | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/avatarmanager.php b/lib/private/avatarmanager.php index 21f88b1fd3f..b2d3e6eb3dd 100644 --- a/lib/private/avatarmanager.php +++ b/lib/private/avatarmanager.php @@ -27,6 +27,7 @@ namespace OC; use OCP\Files\Folder; +use OCP\Files\NotFoundException; use OCP\IAvatarManager; use OCP\IUserManager; use OCP\Files\IRootFolder; @@ -68,6 +69,7 @@ class AvatarManager implements IAvatarManager { * @param string $userId the ownCloud user id * @return \OCP\IAvatar * @throws \Exception In case the username is potentially dangerous + * @throws NotFoundException In case there is no user folder yet */ public function getAvatar($userId) { $user = $this->userManager->get($userId); diff --git a/lib/public/iavatarmanager.php b/lib/public/iavatarmanager.php index 264c4fcf051..cb63ccaf6fd 100644 --- a/lib/public/iavatarmanager.php +++ b/lib/public/iavatarmanager.php @@ -36,6 +36,8 @@ interface IAvatarManager { * @see \OCP\IAvatar * @param string $user the ownCloud user id * @return \OCP\IAvatar + * @throws \Exception In case the username is potentially dangerous + * @throws \OCP\Files\NotFoundException In case there is no user folder yet * @since 6.0.0 */ public function getAvatar($user); |