Index: trunk/phase3/includes/Article.php |
— | — | @@ -248,12 +248,16 @@ |
249 | 249 | if ( $oldid !== 0 ) { |
250 | 250 | # Load the given revision and check whether the page is another one. |
251 | 251 | # In that case, update this instance to reflect the change. |
252 | | - $this->mRevision = Revision::newFromId( $oldid ); |
253 | | - if ( $this->mRevision !== null ) { |
254 | | - // Revision title doesn't match the page title given? |
255 | | - if ( $this->mPage->getID() != $this->mRevision->getPage() ) { |
256 | | - $function = array( get_class( $this->mPage ), 'newFromID' ); |
257 | | - $this->mPage = call_user_func( $function, $this->mRevision->getPage() ); |
| 252 | + if ( $oldid === $this->mPage->getLatest() ) { |
| 253 | + $this->mRevision = $this->mPage->getRevision(); |
| 254 | + } else { |
| 255 | + $this->mRevision = Revision::newFromId( $oldid ); |
| 256 | + if ( $this->mRevision !== null ) { |
| 257 | + // Revision title doesn't match the page title given? |
| 258 | + if ( $this->mPage->getID() != $this->mRevision->getPage() ) { |
| 259 | + $function = array( get_class( $this->mPage ), 'newFromID' ); |
| 260 | + $this->mPage = call_user_func( $function, $this->mRevision->getPage() ); |
| 261 | + } |
258 | 262 | } |
259 | 263 | } |
260 | 264 | } |