From: Brion Vibber Date: Mon, 12 Jun 2006 05:16:12 +0000 (+0000) Subject: * Avoid some notices in page history with bad input X-Git-Tag: 1.31.0-rc.0~56801 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=6a068d1bb1c0fc9d8cdefffef39ee78c450de445;p=lhc%2Fweb%2Fwiklou.git * Avoid some notices in page history with bad input --- 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 */