diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-12-08 23:58:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-08 23:58:17 +0100 |
commit | ed7beb929e21e8663f16b4cb8ffaf12aecb6313a (patch) | |
tree | c58f5556445c09a72dfbf72181833380fb378d2a /core | |
parent | 79ed0d105dc3e5b8fde5e4d8a1ae0f183834349e (diff) | |
parent | 66f523e13ff98aef8cdca9f449df7353dcf60da7 (diff) | |
download | nextcloud-server-ed7beb929e21e8663f16b4cb8ffaf12aecb6313a.tar.gz nextcloud-server-ed7beb929e21e8663f16b4cb8ffaf12aecb6313a.zip |
Merge pull request #6876 from nextcloud/always_img_avatar
Always generate avatar
Diffstat (limited to 'core')
-rw-r--r-- | core/Controller/AvatarController.php | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php index 36b12fbd79c..c01e81a1790 100644 --- a/core/Controller/AvatarController.php +++ b/core/Controller/AvatarController.php @@ -111,6 +111,9 @@ class AvatarController extends Controller { $this->timeFactory = $timeFactory; } + + + /** * @NoAdminRequired * @NoCSRFRequired @@ -133,19 +136,10 @@ class AvatarController extends Controller { $resp = new FileDisplayResponse($avatar, Http::STATUS_OK, ['Content-Type' => $avatar->getMimeType()]); - } catch (NotFoundException $e) { - $user = $this->userManager->get($userId); - $resp = new JSONResponse([ - 'data' => [ - 'displayname' => $user->getDisplayName(), - ], - ]); } catch (\Exception $e) { - $resp = new JSONResponse([ - 'data' => [ - 'displayname' => $userId, - ], - ]); + $resp = new Http\Response(); + $resp->setStatus(Http::STATUS_NOT_FOUND); + return $resp; } // Let cache this! |