Merge pull request #10811 from MrPetovan/bug/photo-route
Add missing Module\Photo route for contact avatar
This commit is contained in:
commit
e10ab489a9
|
@ -97,6 +97,11 @@ class Photo extends BaseModule
|
||||||
$uid = intval(pathinfo($parameters['uid_ext'], PATHINFO_FILENAME));
|
$uid = intval(pathinfo($parameters['uid_ext'], PATHINFO_FILENAME));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Please refactor this for the love of everything that's good
|
||||||
|
if (!empty($parameters['contact_id'])) {
|
||||||
|
$uid = $parameters['contact_id'];
|
||||||
|
}
|
||||||
|
|
||||||
$photo = self::getAvatar($uid, $parameters['type'], $customsize ?: Proxy::PIXEL_SMALL);
|
$photo = self::getAvatar($uid, $parameters['type'], $customsize ?: Proxy::PIXEL_SMALL);
|
||||||
} else {
|
} else {
|
||||||
$photoid = pathinfo($parameters['name'], PATHINFO_FILENAME);
|
$photoid = pathinfo($parameters['name'], PATHINFO_FILENAME);
|
||||||
|
|
|
@ -375,6 +375,7 @@ return [
|
||||||
// User Id Fallback, to remove after version 2021.12
|
// User Id Fallback, to remove after version 2021.12
|
||||||
'/{type}/{uid_ext:\d+\..*}' => [Module\Photo::class, [R::GET]],
|
'/{type}/{uid_ext:\d+\..*}' => [Module\Photo::class, [R::GET]],
|
||||||
'/{type}/{nickname_ext}' => [Module\Photo::class, [R::GET]],
|
'/{type}/{nickname_ext}' => [Module\Photo::class, [R::GET]],
|
||||||
|
'/{type}/{customsize}/{contact_id:\d+}' => [Module\Photo::class, [R::GET]],
|
||||||
// User Id Fallback, to remove after version 2021.12
|
// User Id Fallback, to remove after version 2021.12
|
||||||
'/{type}/{customsize}/{uid_ext:\d+\..*}' => [Module\Photo::class, [R::GET]],
|
'/{type}/{customsize}/{uid_ext:\d+\..*}' => [Module\Photo::class, [R::GET]],
|
||||||
'/{type}/{customsize}/{nickname_ext}' => [Module\Photo::class, [R::GET]],
|
'/{type}/{customsize}/{nickname_ext}' => [Module\Photo::class, [R::GET]],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user