}
if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
- Logger::info('Directly serving XML for uri-id '.$item['uri-id']);
+ Logger::debug('Directly serving XML', ['uri-id' => $item['uri-id']]);
displayShowFeed($item['uri-id'], $item['uid'], false);
}
- if ($item['gravity'] != GRAVITY_PARENT) {
+ if ($item['gravity'] != Item::GRAVITY_PARENT) {
$parent = Post::selectFirstForUser($item_user, $fields, ['uid' => [0, $item_user], 'uri-id' => $item['parent-uri-id']], ['order' => ['uid' => true]]);
$item = $parent ?: $item;
}
}
$parent_uri_id = $item['parent-uri-id'];
}
- $browser_update = intval(DI::pConfig()->get($update_uid, 'system', 'update_interval'));
- if (!empty($browser_update)) {
- $update_date = date(DateTimeFormat::MYSQL, time() - ($browser_update / 500));
- if (!Post::exists(["`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?", $parent_uri_id, 0, $update_uid, $update_date])) {
- Logger::debug('No updated content', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
- return '';
- } else {
- Logger::debug('Updated content found', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
- }
+ if (empty($_REQUEST['force'])) {
+ $browser_update = intval(DI::pConfig()->get($update_uid, 'system', 'update_interval'));
+ if (!empty($browser_update)) {
+ $update_date = date(DateTimeFormat::MYSQL, time() - ($browser_update / 500));
+ if (!Post::exists(["`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?", $parent_uri_id, 0, $update_uid, $update_date])) {
+ Logger::debug('No updated content', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
+ return '';
+ } else {
+ Logger::debug('Updated content found', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
+ }
+ }
+ } else {
+ Logger::debug('Forced content update', ['uri-id' => $uri_id, 'uid' => $update_uid]);
}
} else {
$uri_id = ((DI::args()->getArgc() > 2) ? DI::args()->getArgv()[2] : 0);
// Preparing the meta header
$description = trim(BBCode::toPlaintext($item['body']));
- $title = trim(BBCode::toPlaintext($item['title']));
+ $title = trim(BBCode::toPlaintext($item['title'] ?? ''));
$author_name = $item['author-name'];
$image = DI::baseUrl()->remove($item['author-avatar']);