X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdisplay.php;h=880cfd44b86eb6af3280594f717b4ce74ebb4199;hb=e555ea6aadaaaa178f108b313b728a7b6144b42f;hp=daa78b03e1046717f7ae308d17c54015677777cd;hpb=fd7c1d766c2c922909b858f7af6aa440fbc697aa;p=friendica.git diff --git a/mod/display.php b/mod/display.php index daa78b03e1..880cfd44b8 100644 --- a/mod/display.php +++ b/mod/display.php @@ -1,6 +1,6 @@ DI::args()->getArgv()[1] ?? null]))->rawContent(); + (new Objects(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER, ['guid' => DI::args()->getArgv()[1] ?? null]))->run(); } if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) { @@ -108,55 +110,23 @@ function display_init(App $a) $item = $parent ?: $item; } - $profiledata = display_fetchauthor($item); - - DI::page()['aside'] = Widget\VCard::getHTML($profiledata); + DI::page()['aside'] = Widget\VCard::getHTML(display_fetchauthor($item)); } function display_fetchauthor($item) { - $profiledata = Contact::getByURLForUser($item['author-link'], local_user()); - - // Check for a repeated message - $shared = Item::getShareArray($item); - if (!empty($shared) && empty($shared['comment'])) { - $profiledata = [ - 'uid' => -1, - 'id' => -1, - 'nickname' => '', - 'name' => '', - 'picdate' => '', - 'photo' => '', - 'url' => '', - 'network' => '', - ]; - - if (!empty($shared['author'])) { - $profiledata['name'] = $shared['author']; - } - + if (Diaspora::isReshare($item['body'], true)) { + $shared = Item::getShareArray($item); if (!empty($shared['profile'])) { - $profiledata['url'] = $shared['profile']; - } - - if (!empty($shared['avatar'])) { - $profiledata['photo'] = $shared['avatar']; + $contact = Contact::getByURLForUser($shared['profile'], local_user()); } - - $profiledata['nickname'] = $profiledata['name']; - $profiledata['network'] = Protocol::matchByProfileUrl($profiledata['url']); - - $profiledata['address'] = ''; - $profiledata['about'] = ''; - - $profiledata = Contact::getByURLForUser($profiledata['url'], local_user()) ?: $profiledata; } - if (!empty($profiledata['photo'])) { - $profiledata['photo'] = DI::baseUrl()->remove($profiledata['photo']); + if (empty($contact)) { + $contact = Contact::getById($item['author-id']); } - return $profiledata; + return $contact; } function display_content(App $a, $update = false, $update_uid = 0) @@ -374,7 +344,6 @@ function displayShowFeed(int $uri_id, int $uid, bool $conversation) if ($xml == '') { throw new HTTPException\InternalServerErrorException(DI::l10n()->t('The feed for this item is unavailable.')); } - header("Content-type: application/atom+xml"); - echo $xml; - exit(); + + System::httpExit($xml, Response::TYPE_ATOM); }