X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fgallery.php;h=a478db25d50e7699ba34ee2b7fee12d842a6a159;hb=3a82ff28601d66d443f3b99d0504d35a44712ee5;hp=c6f1585b4bb77886ae198f764e9fcfc2e7858625;hpb=7e6870db914d4e905fc7ae833b69404fd3ea0d3d;p=quix0rs-gnu-social.git diff --git a/lib/gallery.php b/lib/gallery.php index c6f1585b4b..a478db25d5 100644 --- a/lib/gallery.php +++ b/lib/gallery.php @@ -31,17 +31,22 @@ class GalleryAction extends Action { function handle($args) { parent::handle($args); - $nickname = $this->arg('nickname'); - $profile = Profile::staticGet('nickname', $nickname); - if (!$profile) { + $nickname = common_canonical_nickname($this->arg('nickname')); + + $user = User::staticGet('nickname', $nickname); + + if (!$user) { $this->no_such_user(); return; } - $user = User::staticGet($profile->id); - if (!$user) { - $this->no_such_user(); + + $profile = $user->getProfile(); + + if (!$profile) { + $this->server_error(_('User without matching profile in system.')); return; } + $page = $this->arg('page'); if (!$page) { $page = 1; @@ -92,7 +97,13 @@ class GalleryAction extends Action { break; } - $other = Profile::staticGet($this->get_other($subs)); + $other_id = $this->get_other($subs); + $other = Profile::staticGet($other_id); + + if (!$other) { + common_log(LOG_WARNING, 'No matching profile for ' . $other_id); + continue; + } common_element_start('li');