backend/pubsub: better 404 handling, do not cause PHP warning when invalid feed id is being requested

This commit is contained in:
Andrew Dolgov 2011-06-22 15:05:49 +04:00
parent d0f7338009
commit 97279fe6ec
1 changed files with 22 additions and 15 deletions

View File

@ -553,6 +553,8 @@
$result = db_query($link, "SELECT feed_url FROM ttrss_feeds
WHERE id = '$feed_id'");
if (db_num_rows($result) != 0) {
$check_feed_url = db_fetch_result($result, 0, "feed_url");
if ($check_feed_url && ($check_feed_url == $feed_url || !$feed_url)) {
@ -581,6 +583,11 @@
}
} else {
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