From 89f02a1125593d2562bcbcb5f03241f6bc1ce77b Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 28 Sep 2019 15:31:36 +0000 Subject: [PATCH] Fix warnings --- mod/display.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/mod/display.php b/mod/display.php index 874e2e8bf3..8d13db46ff 100644 --- a/mod/display.php +++ b/mod/display.php @@ -53,11 +53,17 @@ function display_init(App $a) if (DBA::isResult($item)) { $nick = $a->user["nickname"]; } + } + // Is this item private but could be visible to the remove visitor? - } elseif (Session::getRemoteContactID($item['uid'])) { + if (!DBA::isResult($item) && remote_user()) { $item = Item::selectFirst($fields, ['guid' => $a->argv[1], 'private' => 1]); if (DBA::isResult($item)) { - $item_user = $item['uid']; + if (!Contact::isFollower(remote_user(), $item['uid'])) { + $item = null; + } else { + $item_user = $item['uid']; + } } } @@ -81,10 +87,6 @@ function display_init(App $a) displayShowFeed($item['id'], $a->argc > 3 && $a->argv[3] == 'conversation.atom'); } - if ($a->argc >= 3 && $nick == 'feed-item') { - displayShowFeed($item['id'], $a->argc > 3 && $a->argv[3] == 'conversation.atom'); - } - if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) { Logger::log('Directly serving XML for id '.$item["id"], Logger::DEBUG); displayShowFeed($item["id"], false); @@ -226,9 +228,11 @@ function display_content(App $a, $update = false, $update_uid = 0) $item_parent = $item["parent"]; $item_parent_uri = $item['parent-uri']; } - } elseif (Session::getRemoteContactID($item['uid'])) { + } + + if (($item_parent == 0) && remote_user()) { $item = Item::selectFirst($fields, ['guid' => $a->argv[1], 'private' => 1]); - if (DBA::isResult($item)) { + if (DBA::isResult($item) && Contact::isFollower(remote_user(), $item['uid'])) { $item_id = $item["id"]; $item_parent = $item["parent"]; $item_parent_uri = $item['parent-uri']; -- 2.39.5