Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/AvatarController.php13
-rw-r--r--core/Controller/GuestAvatarController.php13
2 files changed, 18 insertions, 8 deletions
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php
index 5acfe9cd404..ed8d0c3cdeb 100644
--- a/core/Controller/AvatarController.php
+++ b/core/Controller/AvatarController.php
@@ -114,11 +114,16 @@ class AvatarController extends Controller {
* @return JSONResponse|FileDisplayResponse
*/
public function getAvatar($userId, $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 {
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 {