Made getUndoText() not use unreliable getContent() function (weird wgRequest dependency)
[lhc/web/wiklou.git] / includes / Article.php
index c6bb41b..0999bdb 100644 (file)
@@ -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.