backend/pubsub: better 404 handling, do not cause PHP warning when invalid feed id is being requested
This commit is contained in:
parent
d0f7338009
commit
97279fe6ec
1 changed files with 22 additions and 15 deletions
|
@ -553,6 +553,8 @@
|
||||||
$result = db_query($link, "SELECT feed_url FROM ttrss_feeds
|
$result = db_query($link, "SELECT feed_url FROM ttrss_feeds
|
||||||
WHERE id = '$feed_id'");
|
WHERE id = '$feed_id'");
|
||||||
|
|
||||||
|
if (db_num_rows($result) != 0) {
|
||||||
|
|
||||||
$check_feed_url = db_fetch_result($result, 0, "feed_url");
|
$check_feed_url = db_fetch_result($result, 0, "feed_url");
|
||||||
|
|
||||||
if ($check_feed_url && ($check_feed_url == $feed_url || !$feed_url)) {
|
if ($check_feed_url && ($check_feed_url == $feed_url || !$feed_url)) {
|
||||||
|
@ -581,6 +583,11 @@
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
header('HTTP/1.0 404 Not Found');
|
header('HTTP/1.0 404 Not Found');
|
||||||
|
echo "404 Not found";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
header('HTTP/1.0 404 Not Found');
|
||||||
|
echo "404 Not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
break; // pubsub
|
break; // pubsub
|
||||||
|
|
Loading…
Reference in a new issue