From d1df388226bc38e4195f8e33adf7499bb6139dca Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 4 Dec 2009 13:15:11 +0000 Subject: [PATCH] (bug 15853) Feeds for non-existing pages returned a feed of all pages where rev_page = 0. In theory of course this should never happen, but it does. Conveniently this started returning a nice "page does not exist" error in the feed. Patch by Mormegil. --- RELEASE-NOTES | 2 ++ includes/HistoryPage.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7530fc74e2..b8871e4c59 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -665,6 +665,8 @@ Hopefully we will remove this configuration var soon) due to an infinite loop of job requeues. * (bug 21523) File that can have multiple pages (djvu, pdf, ...) no longer have the page selector when they have only one page +* (bug 15853) Feeds for non-existing pages returned a feed of all pages where + rev_page = 0 == API changes in 1.16 == diff --git a/includes/HistoryPage.php b/includes/HistoryPage.php index ebbc400334..dbe2e0a5ab 100644 --- a/includes/HistoryPage.php +++ b/includes/HistoryPage.php @@ -182,6 +182,12 @@ class HistoryPage { * used by the main UI but that's now handled by the pager. */ function fetchRevisions($limit, $offset, $direction) { + + // Fail if article doesn't exist. + if( !$this->mTitle || !$this->mTitle->exists() ) { + return array(); + } + $dbr = wfGetDB( DB_SLAVE ); if( $direction == HistoryPage::DIR_PREV ) -- 2.20.1