Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -1003,17 +1003,23 @@ |
1004 | 1004 | $this->loadRevisionIds(); |
1005 | 1005 | |
1006 | 1006 | // Load the new revision object |
1007 | | - $this->mNewRev = $this->mNewid |
1008 | | - ? Revision::newFromId( $this->mNewid ) |
1009 | | - : Revision::newFromTitle( $this->getTitle() ); |
| 1007 | + if ( $this->mNewid && ( !$this->canUseWikiPage() |
| 1008 | + || $this->mNewid !== $this->getWikiPage()->getLatest() ) ) |
| 1009 | + { |
| 1010 | + $this->mNewRev = Revision::newFromId( $this->mNewid ); |
| 1011 | + } else { |
| 1012 | + $this->mNewRev = $this->getWikiPage()->getRevision(); |
| 1013 | + $this->mNewPage = $this->getTitle(); |
| 1014 | + } |
1010 | 1015 | |
1011 | 1016 | if ( !$this->mNewRev instanceof Revision ) { |
1012 | 1017 | return false; |
1013 | 1018 | } |
1014 | | - |
| 1019 | + if ( !$this->mNewPage instanceof Title ) { |
| 1020 | + $this->mNewPage = $this->mNewRev->getTitle(); |
| 1021 | + } |
1015 | 1022 | // Update the new revision ID in case it was 0 (makes life easier doing UI stuff) |
1016 | 1023 | $this->mNewid = $this->mNewRev->getId(); |
1017 | | - $this->mNewPage = $this->mNewRev->getTitle(); |
1018 | 1024 | |
1019 | 1025 | // Load the old revision object |
1020 | 1026 | $this->mOldRev = false; |