From: Aaron Schulz Date: Sun, 12 Sep 2010 10:02:19 +0000 (+0000) Subject: Made getUndoText() not use unreliable getContent() function (weird wgRequest dependency) X-Git-Tag: 1.31.0-rc.0~34984 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=dcacf45ef694b1ba9fa1bdd062591bbb3b15fa60 Made getUndoText() not use unreliable getContent() function (weird wgRequest dependency) --- diff --git a/includes/Article.php b/includes/Article.php index c6bb41b292..0999bdbd01 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -321,9 +321,13 @@ class Article { * @return mixed string on success, false on failure */ public function getUndoText( Revision $undo, Revision $undoafter = null ) { + $currentRev = Revision::newFromTitle( $this->mTitle ); + if ( !$currentRev ) { + return false; // no page + } $undo_text = $undo->getText(); $undoafter_text = $undoafter->getText(); - $cur_text = $this->getContent(); + $cur_text = $currentRev->getText(); if ( $cur_text == $undo_text ) { # No use doing a merge if it's just a straight revert.