]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'upstream/develop' into photo-guid
authorMichael <heluecht@pirati.ca>
Mon, 4 Oct 2021 06:21:19 +0000 (06:21 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 4 Oct 2021 06:21:19 +0000 (06:21 +0000)
1  2 
src/Module/Photo.php

index 9ab258cf67aa8c4cbc7484035268686e3b70ccb2,e1a8eef87b85cf4335a77800b4ed0fc62ece7f3a..660f908d229ef11cfe0b48f4d05db7543b744a31
@@@ -108,16 -98,11 +108,16 @@@ class Photo extends BaseModul
                        }
  
                        // Please refactor this for the love of everything that's good
-                       if (!empty($parameters['id'])) {
+                       if (isset($parameters['id'])) {
 -                              $uid = $parameters['id'];
 +                              $id = $parameters['id'];
 +                      }
 +
 +                      if (empty($id)) {
 +                              Logger::notice('No picture id was detected', ['parameters' => $parameters]);
 +                              throw new HTTPException\NotFoundException(DI::l10n()->t('The Photo is not available.'));
                        }
  
 -                      $photo = self::getAvatar($uid, $parameters['type'], $customsize ?: Proxy::PIXEL_SMALL);
 +                      $photo = self::getPhotoByid($id, $parameters['type'], $customsize ?: Proxy::PIXEL_SMALL);
                } else {
                        $photoid = pathinfo($parameters['name'], PATHINFO_FILENAME);
                        $scale = 0;