}
// 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;