From 6a068d1bb1c0fc9d8cdefffef39ee78c450de445 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 12 Jun 2006 05:16:12 +0000 Subject: [PATCH] * Avoid some notices in page history with bad input --- RELEASE-NOTES | 2 ++ includes/PageHistory.php | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b2f207aefc..eceb7dd795 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -473,6 +473,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Update to Vlax Romany localization (rmy) * Update to Latin translation (la) * Update to Dutch translation (nl) +* Avoid some notices in page history with bad input + == Compatibility == diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 7afd629ee0..0dbf356b9d 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -106,6 +106,7 @@ class PageHistory { * "go=last" means to jump to the last history page. */ if (($gowhere = $wgRequest->getText("go")) !== NULL) { + $gourl = null; switch ($gowhere) { case "first": if (($lastid = $this->getLastOffsetForPaging($this->mTitle->getArticleID(), $limit)) === NULL) @@ -113,8 +114,6 @@ class PageHistory { $gourl = $wgTitle->getLocalURL("action=history&limit={$limit}&offset=". wfTimestamp(TS_MW, $lastid)); break; - default: - $gourl = NULL; } if (!is_null($gourl)) { @@ -529,6 +528,9 @@ class PageHistory { if( count( $revisions ) ) { $latestShown = wfTimestamp(TS_MW, $revisions[0]->rev_timestamp); $earliestShown = wfTimestamp(TS_MW, $revisions[count($revisions) - 1]->rev_timestamp); + } else { + $latestShown = null; + $earliestShown = null; } /* Don't announce the limit everywhere if it's the default */ -- 2.20.1