Merge pull request #10812 from MrPetovan/bug/photo-route

Add missing Module\Photo route for post-media id with no customsize
pull/10814/head
Michael Vogel 2021-10-03 14:01:53 +02:00 zatwierdzone przez GitHub
commit 3634009c0a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -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);

Wyświetl plik

@ -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]],