diff options
author | Joas Schilling <coding@schilljs.com> | 2022-02-04 12:12:48 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-02-07 16:47:51 +0100 |
commit | 6dd60b6d304648acf542a84ba76ad5fc0b693b43 (patch) | |
tree | 74a9ab5e9f0c9a212211b417320f3453e10b5647 /core/Controller/GuestAvatarController.php | |
parent | eb340734192e44acc3e4e80442fe54371431ad12 (diff) | |
download | nextcloud-server-6dd60b6d304648acf542a84ba76ad5fc0b693b43.tar.gz nextcloud-server-6dd60b6d304648acf542a84ba76ad5fc0b693b43.zip |
Only allow avatars in 64 and 512 pixel size
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/Controller/GuestAvatarController.php')
-rw-r--r-- | core/Controller/GuestAvatarController.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/Controller/GuestAvatarController.php b/core/Controller/GuestAvatarController.php index 57900af810d..6d14474ed44 100644 --- a/core/Controller/GuestAvatarController.php +++ b/core/Controller/GuestAvatarController.php @@ -76,11 +76,16 @@ class GuestAvatarController extends Controller { public function getAvatar($guestName, $size) { $size = (int) $size; - // min/max size - if ($size > 2048) { - $size = 2048; - } elseif ($size <= 0) { + if ($size <= 64) { + if ($size !== 64) { + $this->logger->debug('Avatar requested in deprecated size ' . $size); + } $size = 64; + } else { + if ($size !== 512) { + $this->logger->debug('Avatar requested in deprecated size ' . $size); + } + $size = 512; } try { |