From 42e77e23acfe9d923b0d7da56e60b54403c53df6 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 3 Oct 2021 19:18:00 -0400 Subject: [PATCH 1/2] Add logging to track a Notice messages - Part of https://github.com/friendica/friendica/issues/10755#issuecomment-933040517 --- src/Model/User.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Model/User.php b/src/Model/User.php index 8f69aa87c8..3178b888e7 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -850,6 +850,10 @@ class User */ public static function getAvatarUrl(array $user, string $size = ''):string { + if (empty($user['nickname'])) { + DI::logger()->warning('Missing user nickname key', ['trace' => System::callstack(20)]); + } + $url = DI::baseUrl() . '/photo/'; switch ($size) { From 297ff765901e5baa55c5a87bb9c5db9450079700 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 3 Oct 2021 20:56:45 -0400 Subject: [PATCH 2/2] Relax check on id parameter in /photo - Address https://github.com/friendica/friendica/issues/10756#issuecomment-933020126 - Address https://github.com/friendica/friendica/issues/10755#issuecomment-933020316 --- src/Module/Photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Photo.php b/src/Module/Photo.php index ea6af26367..e1a8eef87b 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -98,7 +98,7 @@ class Photo extends BaseModule } // Please refactor this for the love of everything that's good - if (!empty($parameters['id'])) { + if (isset($parameters['id'])) { $uid = $parameters['id']; }