Fix warnings

This commit is contained in:
Michael 2019-09-28 15:31:36 +00:00
parent 1c26baec46
commit 89f02a1125

View file

@ -53,13 +53,19 @@ function display_init(App $a)
if (DBA::isResult($item)) { if (DBA::isResult($item)) {
$nick = $a->user["nickname"]; $nick = $a->user["nickname"];
} }
}
// Is this item private but could be visible to the remove visitor? // 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]); $item = Item::selectFirst($fields, ['guid' => $a->argv[1], 'private' => 1]);
if (DBA::isResult($item)) { if (DBA::isResult($item)) {
if (!Contact::isFollower(remote_user(), $item['uid'])) {
$item = null;
} else {
$item_user = $item['uid']; $item_user = $item['uid'];
} }
} }
}
// Is it an item with uid=0? // Is it an item with uid=0?
if (!DBA::isResult($item)) { if (!DBA::isResult($item)) {
@ -81,10 +87,6 @@ function display_init(App $a)
displayShowFeed($item['id'], $a->argc > 3 && $a->argv[3] == 'conversation.atom'); 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')) { if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
Logger::log('Directly serving XML for id '.$item["id"], Logger::DEBUG); Logger::log('Directly serving XML for id '.$item["id"], Logger::DEBUG);
displayShowFeed($item["id"], false); displayShowFeed($item["id"], false);
@ -226,9 +228,11 @@ function display_content(App $a, $update = false, $update_uid = 0)
$item_parent = $item["parent"]; $item_parent = $item["parent"];
$item_parent_uri = $item['parent-uri']; $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]); $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_id = $item["id"];
$item_parent = $item["parent"]; $item_parent = $item["parent"];
$item_parent_uri = $item['parent-uri']; $item_parent_uri = $item['parent-uri'];