From c84d4104e853ba7f6037452fd660b7d38578bed4 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 3 Oct 2021 07:58:52 -0400 Subject: [PATCH] Add missing Module\Photo route for post-media id with no customsize --- src/Module/Photo.php | 4 ++-- static/routes.config.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 9a59d967b0..ea6af26367 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -98,8 +98,8 @@ class Photo extends BaseModule } // Please refactor this for the love of everything that's good - if (!empty($parameters['contact_id'])) { - $uid = $parameters['contact_id']; + if (!empty($parameters['id'])) { + $uid = $parameters['id']; } $photo = self::getAvatar($uid, $parameters['type'], $customsize ?: Proxy::PIXEL_SMALL); diff --git a/static/routes.config.php b/static/routes.config.php index 72a71f2c1b..1bcae4a7d3 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -372,10 +372,11 @@ return [ '/photo' => [ '/{name}' => [Module\Photo::class, [R::GET]], + '/{type}/{id:\d+}' => [Module\Photo::class, [R::GET]], // User Id Fallback, to remove after version 2021.12 '/{type}/{uid_ext:\d+\..*}' => [Module\Photo::class, [R::GET]], '/{type}/{nickname_ext}' => [Module\Photo::class, [R::GET]], - '/{type}/{customsize}/{contact_id:\d+}' => [Module\Photo::class, [R::GET]], + '/{type}/{customsize}/{id:\d+}' => [Module\Photo::class, [R::GET]], // User Id Fallback, to remove after version 2021.12 '/{type}/{customsize}/{uid_ext:\d+\..*}' => [Module\Photo::class, [R::GET]], '/{type}/{customsize}/{nickname_ext}' => [Module\Photo::class, [R::GET]],