From: Rob Church Date: Sun, 26 Feb 2006 16:10:58 +0000 (+0000) Subject: * (bug 4838) Add relative oldids (prev, next, cur) for raw pages X-Git-Tag: 1.6.0~270 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/config/%7B%24admin_url%7Dmembres?a=commitdiff_plain;h=94b4504457a90c5f911a25ab70d0af40cd0382ea;p=lhc%2Fweb%2Fwiklou.git * (bug 4838) Add relative oldids (prev, next, cur) for raw pages Patch by Lupin --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7cca090f8a..5e6719d8b5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -660,7 +660,8 @@ fully support the editing toolbar, but was found to be too confusing. updated language code assignments * (bug 5081) Remove bogus fix for invalid characters in links which simply broke use of legitimate multiple whitespace characters in bracketed link. - +* (bug 4838) Add relative oldids (prev, next, cur) for raw pages + Patch by Lupin === Caveats === diff --git a/includes/RawPage.php b/includes/RawPage.php index ee28f47b21..b622fec433 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -40,7 +40,21 @@ class RawPage { $smaxage = $this->mRequest->getIntOrNull( 'smaxage', $wgSquidMaxage ); $maxage = $this->mRequest->getInt( 'maxage', $wgSquidMaxage ); $this->mExpandTemplates = $this->mRequest->getVal( 'templates' ) === 'expand'; - $this->mOldId = $this->mRequest->getInt( 'oldid' ); + + $oldid = $this->mRequest->getInt( 'oldid' ); + switch ( $wgRequest->getText( 'direction' ) ) { + case 'next': + $oldid = $this->mTitle->getNextRevisionId( $oldid ); + break; + case 'prev': + $oldid = $this->mTitle->getPreviousRevisionId( $oldid ); + break; + case 'cur': + $oldid = 0; + break; + } + $this->mOldId = $oldid; + # special case for 'generated' raw things: user css/js $gen = $this->mRequest->getVal( 'gen' );