fix a bunch of warnings related to generated feeds

This commit is contained in:
Andrew Dolgov 2021-02-12 22:00:33 +03:00
parent 481bd76100
commit d3940b6259
1 changed files with 10 additions and 12 deletions

View File

@ -163,7 +163,7 @@ class Handler_Public extends Handler {
$tpl->addBlock('feed'); $tpl->addBlock('feed');
$tpl->generateOutputToString($tmp); $tpl->generateOutputToString($tmp);
if (@!clean($_REQUEST["noxml"])) { if (empty($_REQUEST["noxml"])) {
header("Content-Type: text/xml; charset=utf-8"); header("Content-Type: text/xml; charset=utf-8");
} else { } else {
header("Content-Type: text/plain; charset=utf-8"); header("Content-Type: text/plain; charset=utf-8");
@ -460,19 +460,17 @@ class Handler_Public extends Handler {
function rss() { function rss() {
$feed = clean($_REQUEST["id"]); $feed = clean($_REQUEST["id"]);
$key = clean($_REQUEST["key"]); $key = clean($_REQUEST["key"]);
$is_cat = clean($_REQUEST["is_cat"]); $is_cat = clean($_REQUEST["is_cat"] ?? false);
$limit = (int)clean($_REQUEST["limit"]); $limit = (int)clean($_REQUEST["limit"] ?? 0);
$offset = (int)clean($_REQUEST["offset"]); $offset = (int)clean($_REQUEST["offset"] ?? 0);
$search = clean($_REQUEST["q"]); $search = clean($_REQUEST["q"] ?? "");
$view_mode = clean($_REQUEST["view-mode"]); $view_mode = clean($_REQUEST["view-mode"] ?? "");
$order = clean($_REQUEST["order"]); $order = clean($_REQUEST["order"] ?? "");
$start_ts = clean($_REQUEST["ts"]); $start_ts = (int)clean($_REQUEST["ts"] ?? 0);
$format = clean($_REQUEST['format']); $format = clean($_REQUEST['format'] ?? "atom");
$orig_guid = clean($_REQUEST["orig_guid"]); $orig_guid = clean($_REQUEST["orig_guid"] ?? false);
if (!$format) $format = 'atom';
if (SINGLE_USER_MODE) { if (SINGLE_USER_MODE) {
UserHelper::authenticate("admin", null); UserHelper::authenticate("admin", null);