dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
dae0538
)
Bug 5136: corner cases with relative oldids are wrong
author
Lupin
<lupin-wp@users.mediawiki.org>
Wed, 1 Mar 2006 03:28:48 +0000
(
03:28
+0000)
committer
Lupin
<lupin-wp@users.mediawiki.org>
Wed, 1 Mar 2006 03:28:48 +0000
(
03:28
+0000)
includes/RawPage.php
patch
|
blob
|
history
diff --git
a/includes/RawPage.php
b/includes/RawPage.php
index
b622fec
..
0e46df5
100644
(file)
--- a/
includes/RawPage.php
+++ b/
includes/RawPage.php
@@
-44,10
+44,21
@@
class RawPage {
$oldid = $this->mRequest->getInt( 'oldid' );
switch ( $wgRequest->getText( 'direction' ) ) {
case 'next':
$oldid = $this->mRequest->getInt( 'oldid' );
switch ( $wgRequest->getText( 'direction' ) ) {
case 'next':
- $oldid = $this->mTitle->getNextRevisionId( $oldid );
+ # output next revision, or nothing if there isn't one
+ if ( $oldid ) {
+ $oldid = $this->mTitle->getNextRevisionId( $oldid );
+ }
+ $oldid = $oldid ? $oldid : -1;
break;
case 'prev':
break;
case 'prev':
- $oldid = $this->mTitle->getPreviousRevisionId( $oldid );
+ # output previous revision, or nothing if there isn't one
+ if ( ! $oldid ) {
+ # get the current revision so we can get the penultimate one
+ $this->mArticle->getTouched();
+ $oldid = $this->mArticle->mLatest;
+ }
+ $prev = $this->mTitle->getPreviousRevisionId( $oldid );
+ $oldid = $prev ? $prev : -1 ;
break;
case 'cur':
$oldid = 0;
break;
case 'cur':
$oldid = 0;