]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #10812 from MrPetovan/bug/photo-route
authorMichael Vogel <icarus@dabo.de>
Sun, 3 Oct 2021 12:01:53 +0000 (14:01 +0200)
committerGitHub <noreply@github.com>
Sun, 3 Oct 2021 12:01:53 +0000 (14:01 +0200)
Add missing Module\Photo route for post-media id with no customsize

src/Module/Photo.php
static/routes.config.php

index 9a59d967b06e31941f86643748d63e0a2fbbc8c7..ea6af2636739ee66533025796f1269a779b89875 100644 (file)
@@ -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);
index 72a71f2c1bc943cd80a37bcacaa7bfcf5895d910..1bcae4a7d39bfce9624122ca4b26bec9e5b26bce 100644 (file)
@@ -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]],