Index: trunk/phase3/includes/DifferenceEngine.php |
— | — | @@ -558,16 +558,15 @@ |
559 | 559 | } |
560 | 560 | |
561 | 561 | // Load the new revision object |
562 | | - if( $this->mNewid ) { |
563 | | - $this->mNewRev = Revision::newFromId( $this->mNewid ); |
564 | | - } else { |
565 | | - $this->mNewRev = Revision::newFromTitle( $this->mTitle ); |
566 | | - } |
567 | | - |
568 | | - if( is_null( $this->mNewRev ) ) { |
| 562 | + $this->mNewRev = $this->mNewid |
| 563 | + ? Revision::newFromId( $this->mNewid ) |
| 564 | + : Revision::newFromTitle( $this->mTitle ); |
| 565 | + if( !$this->mNewRev instanceof Revision ) |
569 | 566 | return false; |
570 | | - } |
571 | | - |
| 567 | + |
| 568 | + // Update the new revision ID in case it was 0 (makes life easier doing UI stuff) |
| 569 | + $this->mNewid = $this->mNewRev->getId(); |
| 570 | + |
572 | 571 | // Set assorted variables |
573 | 572 | $timestamp = $wgLang->timeanddate( $this->mNewRev->getTimestamp(), true ); |
574 | 573 | $this->mNewPage = $this->mNewRev->getTitle(); |
— | — | @@ -616,7 +615,8 @@ |
617 | 616 | $oldEdit = $this->mOldPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mOldid ); |
618 | 617 | $this->mOldtitle = "<a href='$oldLink'>" . htmlspecialchars( wfMsg( 'revisionasof', $t ) ) |
619 | 618 | . "</a> (<a href='$oldEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)"; |
620 | | - //now that we considered old rev, we can make undo link (bug 8133, multi-edit undo) |
| 619 | + |
| 620 | + // Add an "undo" link |
621 | 621 | $newUndo = $this->mNewPage->escapeLocalUrl( 'action=edit&undoafter=' . $this->mOldid . '&undo=' . $this->mNewid); |
622 | 622 | $this->mNewtitle .= " (<a href='$newUndo'>" . htmlspecialchars( wfMsg( 'editundo' ) ) . "</a>)"; |
623 | 623 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -352,6 +352,8 @@ |
353 | 353 | * Fixed regression in blocking of username '0' |
354 | 354 | * (bug 9437) Don't overwrite edit form submission handler when setting up |
355 | 355 | edit box scroll position preserve/restore behaviour |
| 356 | +* (bug 10805) Fix "undo" link when viewing the diff of the most recent |
| 357 | + change to a page using "diff=0" |
356 | 358 | |
357 | 359 | == API changes since 1.10 == |
358 | 360 | |