r90721 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90720‎ | r90721 | r90722 >
Date:17:15, 24 June 2011
Author:ialex
Status:ok
Tags:
Comment:
Simplify a bit by using getRawText() instead of creating a Revision object
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -363,13 +363,12 @@
364364 * @return mixed string on success, false on failure
365365 */
366366 public function getUndoText( Revision $undo, Revision $undoafter = null ) {
367 - $currentRev = Revision::newFromTitle( $this->mTitle );
368 - if ( !$currentRev ) {
 367+ $cur_text = $this->getRawText();
 368+ if ( $cur_text === false ) {
369369 return false; // no page
370370 }
371371 $undo_text = $undo->getText();
372372 $undoafter_text = $undoafter->getText();
373 - $cur_text = $currentRev->getText();
374373
375374 if ( $cur_text == $undo_text ) {
376375 # No use doing a merge if it's just a straight revert.

Status & tagging log