*Revert r27091. This breaks some extensions by randomly moving a major method variabl...
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 1 Nov 2007 17:56:19 +0000 (17:56 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 1 Nov 2007 17:56:19 +0000 (17:56 +0000)
includes/EditPage.php

index dc8449d..ea6ecff 100644 (file)
@@ -8,12 +8,6 @@
  * The actual database and text munging is still in Article,
  * but it should get easier to call those from alternate
  * interfaces.
- *
- * EditPage now holds references to two distinct Titles:
- * $uiTitle is the page that forms submit to, links point to,
- * redirects go to, etc. $dbTitle (as well as $mArticle) is the
- * page in the database that is actually being edited. These are
- * usually the same, but they are now allowed to be different.
  */
 class EditPage {
        const AS_SUCCESS_UPDATE                         = 200;
@@ -40,8 +34,7 @@ class EditPage {
        const AS_SPAM_ERROR                                     = 232;
 
        var $mArticle;
-       var $dbTitle;
-       var $uiTitle;
+       var $mTitle;
        var $mMetaData = '';
        var $isConflict = false;
        var $isCssJsSubpage = false;
@@ -72,15 +65,9 @@ class EditPage {
        # extensions should take care to _append_ to the present value
        public $editFormPageTop; // Before even the preview
        public $editFormTextTop;
-       public $editFormTextBeforeContent;
        public $editFormTextAfterWarn;
        public $editFormTextAfterTools;
        public $editFormTextBottom;
-       
-       /* $didSave should be set to true whenever an article was succesfully altered. */
-       public $didSave = false;
-       
-       public $suppressIntro = false;
 
        /**
         * @todo document
@@ -89,13 +76,11 @@ class EditPage {
        function EditPage( $article ) {
                $this->mArticle =& $article;
                global $wgTitle;
-               $this->uiTitle =& $wgTitle;
-               $this->dbTitle = $article->getTitle();
+               $this->mTitle =& $wgTitle;
 
                # Placeholders for text injection by hooks (empty per default)
                $this->editFormPageTop =
                $this->editFormTextTop =
-               $this->editFormTextBeforeContent =
                $this->editFormTextAfterWarn =
                $this->editFormTextAfterTools =
                $this->editFormTextBottom = "";
@@ -116,10 +101,10 @@ class EditPage {
                wfProfileIn( __METHOD__ );
 
                $text = '';
-               if( !$this->dbTitle->exists() ) {
-                       if ( $this->dbTitle->getNamespace() == NS_MEDIAWIKI ) {
+               if( !$this->mTitle->exists() ) {
+                       if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
                                # If this is a system message, get the default text. 
-                               $text = wfMsgWeirdKey ( $this->dbTitle->getText() ) ;
+                               $text = wfMsgWeirdKey ( $this->mTitle->getText() ) ;
                        } else {
                                # If requested, preload some text.
                                $text = $this->getPreloadedText( $preload );
@@ -356,9 +341,9 @@ class EditPage {
                        return;
                }
 
-               $permErrors = $this->dbTitle->getUserPermissionsErrors('edit', $wgUser);
-               if( !$this->dbTitle->exists() )
-                       $permErrors += array_diff( $this->dbTitle->getUserPermissionsErrors('create', $wgUser), $permErrors );
+               $permErrors = $this->mTitle->getUserPermissionsErrors('edit', $wgUser);
+               if( !$this->mTitle->exists() )
+                       $permErrors += array_diff( $this->mTitle->getUserPermissionsErrors('create', $wgUser), $permErrors );
 
                # Ignore some permissions errors.
                $remove = array();
@@ -410,8 +395,8 @@ class EditPage {
 
                $this->isConflict = false;
                // css / js subpages of user pages get a special treatment
-               $this->isCssJsSubpage      = $this->dbTitle->isCssJsSubpage();
-               $this->isValidCssJsSubpage = $this->dbTitle->isValidCssJsSubpage();
+               $this->isCssJsSubpage      = $wgTitle->isCssJsSubpage();
+               $this->isValidCssJsSubpage = $wgTitle->isValidCssJsSubpage();
 
                /* Notice that we can't use isDeleted, because it returns true if article is ever deleted
                 * no matter it's current state
@@ -423,7 +408,7 @@ class EditPage {
                         * deletes. This is done on every preview and save request. Move it further down
                         * to only perform it on saves
                         */
-                       if ( $this->dbTitle->isDeleted() ) {
+                       if ( $this->mTitle->isDeleted() ) {
                                $this->lastDelete = $this->getLastDelete();
                                if ( !is_null($this->lastDelete) ) {
                                        $deletetime = $this->lastDelete->log_timestamp;
@@ -438,7 +423,7 @@ class EditPage {
                if( $this->formtype == 'initial' || $this->firsttime )
                        $this->showIntro();
        
-               if( $this->dbTitle->isTalkPage() ) {
+               if( $this->mTitle->isTalkPage() ) {
                        $wgOut->addWikiText( wfMsg( 'talkpagetext' ) );
                }
 
@@ -464,8 +449,8 @@ class EditPage {
                                wfProfileOut( $fname );
                                return;
                        }
-                       if( !$this->dbTitle->getArticleId() ) 
-                               wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->dbTitle ) );
+                       if( !$this->mTitle->getArticleId() ) 
+                               wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mTitle ) );
                }
 
                $this->showEditForm();
@@ -489,10 +474,10 @@ class EditPage {
                } elseif( $this->section == 'new' ) {
                        // Nothing *to* preview for new sections
                        return false;
-               } elseif( ( $wgRequest->getVal( 'preload' ) !== '' || $this->dbTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
+               } elseif( ( $wgRequest->getVal( 'preload' ) !== '' || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
                        // Standard preference behaviour
                        return true;
-               } elseif( !$this->dbTitle->exists() && $this->dbTitle->getNamespace() == NS_CATEGORY ) {
+               } elseif( !$this->mTitle->exists() && $this->mTitle->getNamespace() == NS_CATEGORY ) {
                        // Categories are special
                        return true;
                } else {
@@ -569,7 +554,7 @@ class EditPage {
                        $this->watchthis = $request->getCheck( 'wpWatchthis' );
 
                        # Don't force edit summaries when a user is editing their own user or talk page
-                       if( ( $this->dbTitle->mNamespace == NS_USER || $this->dbTitle->mNamespace == NS_USER_TALK ) && $this->dbTitle->getText() == $wgUser->getName() ) {
+                       if( ( $this->mTitle->mNamespace == NS_USER || $this->mTitle->mNamespace == NS_USER_TALK ) && $this->mTitle->getText() == $wgUser->getName() ) {
                                $this->allowBlankSummary = true;
                        } else {
                                $this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' );
@@ -625,8 +610,7 @@ class EditPage {
         */
        private function showIntro() {
                global $wgOut, $wgUser;
-               if( $this->suppressIntro ) return;
-               if( !$this->showCustomIntro() && !$this->dbTitle->exists() ) {
+               if( !$this->showCustomIntro() && !$this->mTitle->exists() ) {
                        if( $wgUser->isLoggedIn() ) {
                                $wgOut->addWikiText( wfMsg( 'newarticletext' ) );
                        } else {
@@ -687,7 +671,7 @@ class EditPage {
                        wfProfileOut( $fname );
                        return self::AS_SPAM_ERROR;
                }
-               if ( $wgFilterCallback && $wgFilterCallback( $this->dbTitle, $this->textbox1, $this->section ) ) {
+               if ( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section ) ) {
                        # Error messages or other handling should be performed by the filter function
                        wfProfileOut( "$fname-checks" );
                        wfProfileOut( $fname );
@@ -704,7 +688,7 @@ class EditPage {
                        wfProfileOut( $fname );
                        return self::AS_HOOK_ERROR_EXPECTED;
                }
-               if ( $wgUser->isBlockedFrom( $this->uiTitle, false ) ) {
+               if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) {
                        # Check block state against master, thus 'false'.
                        wfProfileOut( "$fname-checks" );
                        wfProfileOut( $fname );
@@ -754,11 +738,11 @@ class EditPage {
                wfProfileOut( "$fname-checks" );
 
                # If article is new, insert it.
-               $aid = $this->dbTitle->getArticleID( GAID_FOR_UPDATE );
+               $aid = $this->mTitle->getArticleID( GAID_FOR_UPDATE );
                if ( 0 == $aid ) {
 
                        // Late check for create permission, just in case *PARANOIA*
-                       if ( !$this->dbTitle->userCan( 'create' ) ) {
+                       if ( !$this->mTitle->userCan( 'create' ) ) {
                                wfDebug( "$fname: no create permission\n" );
                                wfProfileOut( $fname );
                                return self::AS_NO_CREATE_PERMISSION;
@@ -929,8 +913,8 @@ class EditPage {
                $this->textbox1 = $this->getContent(false);
                if ($this->textbox1 === false) return false;
 
-               if ( !$this->mArticle->exists() && $this->dbTitle->getNamespace() == NS_MEDIAWIKI )
-                       $this->textbox1 = wfMsgWeirdKey( $this->dbTitle->getText() );
+               if ( !$this->mArticle->exists() && $this->mArticle->mTitle->getNamespace() == NS_MEDIAWIKI )
+                       $this->textbox1 = wfMsgWeirdKey( $this->mArticle->mTitle->getText() );
                wfProxyCheck();
                return true;
        }
@@ -961,7 +945,7 @@ class EditPage {
                }
 
                if ( $this->isConflict ) {
-                       $s = wfMsg( 'editconflict', $this->uiTitle->getPrefixedText() );
+                       $s = wfMsg( 'editconflict', $this->mTitle->getPrefixedText() );
                        $wgOut->setPageTitle( $s );
                        $wgOut->addWikiText( wfMsg( 'explainconflict' ) );
 
@@ -972,9 +956,9 @@ class EditPage {
 
                        if( $this->section != '' ) {
                                if( $this->section == 'new' ) {
-                                       $s = wfMsg('editingcomment', $this->uiTitle->getPrefixedText() );
+                                       $s = wfMsg('editingcomment', $this->mTitle->getPrefixedText() );
                                } else {
-                                       $s = wfMsg('editingsection', $this->uiTitle->getPrefixedText() );
+                                       $s = wfMsg('editingsection', $this->mTitle->getPrefixedText() );
                                        $matches = array();
                                        if( !$this->summary && !$this->preview && !$this->diff ) {
                                                preg_match( "/^(=+)(.+)\\1/mi",
@@ -989,7 +973,7 @@ class EditPage {
                                        }
                                }
                        } else {
-                               $s = wfMsg( 'editing', $this->uiTitle->getPrefixedText() );
+                               $s = wfMsg( 'editing', $this->mTitle->getPrefixedText() );
                        }
                        $wgOut->setPageTitle( $s );
 
@@ -1034,17 +1018,17 @@ class EditPage {
                                if( $this->isValidCssJsSubpage ) {
                                        $wgOut->addWikiText( wfMsg( 'usercssjsyoucanpreview' ) );
                                } else {
-                                       $wgOut->addWikiText( wfMsg( 'userinvalidcssjstitle', $this->uiTitle->getSkinFromCssJsSubpage() ) );
+                                       $wgOut->addWikiText( wfMsg( 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ) );
                                }
                        }
                }
 
-               if( $this->dbTitle->getNamespace() == NS_MEDIAWIKI ) {
+               if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
                        # Show a warning if editing an interface message
                        $wgOut->addWikiText( wfMsg( 'editinginterface' ) );
-               } elseif( $this->dbTitle->isProtected( 'edit' ) ) {
+               } elseif( $this->mTitle->isProtected( 'edit' ) ) {
                        # Is the title semi-protected?
-                       if( $this->dbTitle->isSemiProtected() ) {
+                       if( $this->mTitle->isSemiProtected() ) {
                                $notice = wfMsg( 'semiprotectedpagewarning' );
                                if( wfEmptyMsg( 'semiprotectedpagewarning', $notice ) || $notice == '-' )
                                        $notice = '';
@@ -1054,9 +1038,9 @@ class EditPage {
                        }
                        $wgOut->addWikiText( $notice );
                }
-               if ( $this->dbTitle->isCascadeProtected() ) {
+               if ( $this->mTitle->isCascadeProtected() ) {
                        # Is this page under cascading protection from some source pages?
-                       list($cascadeSources, /* $restrictions */) = $this->dbTitle->getCascadeProtectionSources();
+                       list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();
                        if ( count($cascadeSources) > 0 ) {
                                # Explain, and list the titles responsible
                                $notice = wfMsgExt( 'cascadeprotectedwarning', array('parsemag'), count($cascadeSources) ) . "\n";
@@ -1091,12 +1075,12 @@ class EditPage {
 
                $q = 'action=submit';
                #if ( "no" == $redirect ) { $q .= "&redirect=no"; }
-               $action = $this->uiTitle->escapeLocalURL( $q );
+               $action = $this->mTitle->escapeLocalURL( $q );
 
                $summary = wfMsg('summary');
                $subject = wfMsg('subject');
 
-               $cancel = $sk->makeKnownLink( $this->uiTitle->getPrefixedText(),
+               $cancel = $sk->makeKnownLink( $this->mTitle->getPrefixedText(),
                                wfMsgExt('cancel', array('parseinline')) );
                $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ));
                $edithelp = '<a target="helpwindow" href="'.$edithelpurl.'">'.
@@ -1122,10 +1106,10 @@ class EditPage {
                        if( $wgUser->getOption( 'watchdefault' ) ) {
                                # Watch all edits
                                $this->watchthis = true;
-                       } elseif( $wgUser->getOption( 'watchcreations' ) && !$this->dbTitle->exists() ) {
+                       } elseif( $wgUser->getOption( 'watchcreations' ) && !$this->mTitle->exists() ) {
                                # Watch creations
                                $this->watchthis = true;
-                       } elseif( $this->dbTitle->userIsWatching() ) {
+                       } elseif( $this->mTitle->userIsWatching() ) {
                                # Already watched
                                $this->watchthis = true;
                        }
@@ -1157,12 +1141,12 @@ class EditPage {
                if( $this->section == 'new' ) {
                        $commentsubject="<span id='wpSummaryLabel'><label for='wpSummary'>{$subject}:</label></span>\n<div class='editOptions'>\n<input tabindex='1' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' /><br />";
                        $editsummary = '';
-                       $subjectpreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('subject-preview').':'.$sk->commentBlock( $this->summary, $this->dbTitle )."</div>\n" : '';
+                       $subjectpreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('subject-preview').':'.$sk->commentBlock( $this->summary, $this->mTitle )."</div>\n" : '';
                        $summarypreview = '';
                } else {
                        $commentsubject = '';
                        $editsummary="<span id='wpSummaryLabel'><label for='wpSummary'>{$summary}:</label></span>\n<div class='editOptions'>\n<input tabindex='2' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' /><br />";
-                       $summarypreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('summary-preview').':'.$sk->commentBlock( $this->summary, $this->dbTitle )."</div>\n" : '';
+                       $summarypreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('summary-preview').':'.$sk->commentBlock( $this->summary, $this->mTitle )."</div>\n" : '';
                        $subjectpreview = '';
                }
 
@@ -1235,7 +1219,6 @@ END
 $recreate
 {$commentsubject}
 {$subjectpreview}
-{$this->editFormTextBeforeContent}
 <textarea tabindex='1' accesskey="," name="wpTextbox1" id="wpTextbox1" rows='{$rows}'
 cols='{$cols}'{$ew} $hidden>
 END
@@ -1305,7 +1288,7 @@ END
                if ( $this->isConflict ) {
                        $wgOut->addWikiText( '==' . wfMsg( "yourdiff" ) . '==' );
 
-                       $de = new DifferenceEngine( $this->dbTitle );
+                       $de = new DifferenceEngine( $this->mTitle );
                        $de->setText( $this->textbox2, $this->textbox1 );
                        $de->showDiff( wfMsg( "yourtext" ), wfMsg( "storedversion" ) );
 
@@ -1342,12 +1325,12 @@ END
                global $wgOut;
 
                $wgOut->addHTML( '<div id="wikiPreview">' );
-               if($this->dbTitle->getNamespace() == NS_CATEGORY) {
+               if($this->mTitle->getNamespace() == NS_CATEGORY) {
                        $this->mArticle->openShowCategory();
                }
                wfRunHooks( 'OutputPageBeforeHTML',array( &$wgOut, &$text ) );
                $wgOut->addHTML( $text );
-               if($this->dbTitle->getNamespace() == NS_CATEGORY) {
+               if($this->mTitle->getNamespace() == NS_CATEGORY) {
                        $this->mArticle->closeShowCategory();
                }
                $wgOut->addHTML( '</div>' );
@@ -1368,7 +1351,7 @@ END
                $wgOut->addHTML( '<script type="'.$wgJsMimeType.'" src="' .
                        htmlspecialchars( "$wgStylePath/common/preview.js?$wgStyleVersion" ) .
                        '"></script>' . "\n" );
-               $liveAction = $this->uiTitle->getLocalUrl( 'action=submit&wpPreview=true&live=true' );
+               $liveAction = $wgTitle->getLocalUrl( 'action=submit&wpPreview=true&live=true' );
                return "return !lpDoPreview(" .
                        "editform.wpTextbox1.value," .
                        '"' . $liveAction . '"' . ")";
@@ -1388,8 +1371,8 @@ END
                               'log_comment',
                               'log_params',
                               'user_name', ),
-                       array( 'log_namespace' => $this->dbTitle->getNamespace(),
-                              'log_title' => $this->dbTitle->getDBkey(),
+                       array( 'log_namespace' => $this->mTitle->getNamespace(),
+                              'log_title' => $this->mTitle->getDBkey(),
                               'log_type' => 'delete',
                               'log_action' => 'delete',
                               'user_id=log_user' ),
@@ -1445,13 +1428,13 @@ END
                # XXX: stupid php bug won't let us use $wgTitle->isCssJsSubpage() here
 
                if ( $this->isCssJsSubpage ) {
-                       if(preg_match("/\\.css$/", $this->dbTitle->getText() ) ) {
+                       if(preg_match("/\\.css$/", $wgTitle->getText() ) ) {
                                $previewtext = wfMsg('usercsspreview');
-                       } else if(preg_match("/\\.js$/", $this->dbTitle->getText() ) ) {
+                       } else if(preg_match("/\\.js$/", $wgTitle->getText() ) ) {
                                $previewtext = wfMsg('userjspreview');
                        }
                        $parserOptions->setTidy(true);
-                       $parserOutput = $wgParser->parse( $previewtext , $this->dbTitle, $parserOptions );
+                       $parserOutput = $wgParser->parse( $previewtext , $wgTitle, $parserOptions );
                        $wgOut->addHTML( $parserOutput->mText );
                        wfProfileOut( $fname );
                        return $previewhead;
@@ -1467,13 +1450,13 @@ END
                        if ( $this->mMetaData != "" ) $toparse .= "\n" . $this->mMetaData ;
                        $parserOptions->setTidy(true);
                        $parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ) ."\n\n",
-                                       $this->dbTitle, $parserOptions );
+                                       $wgTitle, $parserOptions );
 
                        $previewHTML = $parserOutput->getText();
                        $wgOut->addParserOutputNoText( $parserOutput );
                        
                        # ParserOutput might have altered the page title, so reset it
-                       $wgOut->setPageTitle( wfMsg( 'editing', $this->uiTitle->getPrefixedText() ) );                  
+                       $wgOut->setPageTitle( wfMsg( 'editing', $this->mTitle->getPrefixedText() ) );                   
 
                        foreach ( $parserOutput->getTemplates() as $ns => $template)
                                foreach ( array_keys( $template ) as $dbk)
@@ -1495,7 +1478,7 @@ END
                # (This happens when a user is blocked during edit, for instance)
                $first = $this->firsttime || ( !$this->save && $this->textbox1 == '' );
                if( $first ) {
-                       $source = $this->dbTitle->exists() ? $this->getContent() : false;
+                       $source = $this->mTitle->exists() ? $this->getContent() : false;
                } else {
                        $source = $this->textbox1;
                }
@@ -1506,7 +1489,7 @@ END
                        $cols = $wgUser->getOption( 'cols' );
                        $attribs = array( 'id' => 'wpTextbox1', 'name' => 'wpTextbox1', 'cols' => $cols, 'rows' => $rows, 'readonly' => 'readonly' );
                        $wgOut->addHtml( '<hr />' );
-                       $wgOut->addWikiText( wfMsg( $first ? 'blockedoriginalsource' : 'blockededitsource', $this->dbTitle->getPrefixedText() ) );
+                       $wgOut->addWikiText( wfMsg( $first ? 'blockedoriginalsource' : 'blockededitsource', $this->mTitle->getPrefixedText() ) );
                        $wgOut->addHtml( wfOpenElement( 'textarea', $attribs ) . htmlspecialchars( $source ) . wfCloseElement( 'textarea' ) );
                }
        }
@@ -1519,14 +1502,14 @@ END
                $skin = $wgUser->getSkin();
 
                $loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
-               $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->uiTitle->getPrefixedUrl() );
+               $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->mTitle->getPrefixedUrl() );
 
                $wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setArticleRelated( false );
 
                $wgOut->addHtml( wfMsgWikiHtml( 'whitelistedittext', $loginLink ) );
-               $wgOut->returnToMain( false, $this->uiTitle );
+               $wgOut->returnToMain( false, $this->mTitle );
        }
 
        /**
@@ -1541,7 +1524,7 @@ END
                $wgOut->setArticleRelated( false );
 
                $wgOut->addWikiText( wfMsg( 'nosuchsectiontext', $this->section ) );
-               $wgOut->returnToMain( false, $this->uiTitle );
+               $wgOut->returnToMain( false, $this->mTitle );
        }
 
        /**
@@ -1560,7 +1543,7 @@ END
                if ( $match )
                        $wgOut->addWikiText( wfMsg( 'spamprotectionmatch', "<nowiki>{$match}</nowiki>" ) );
 
-               $wgOut->returnToMain( false, $this->uiTitle );
+               $wgOut->returnToMain( false, $this->mTitle );
        }
 
        /**
@@ -1575,7 +1558,7 @@ END
 
                // This is the revision the editor started from
                $baseRevision = Revision::loadFromTimestamp(
-                       $db, $this->dbTitle, $this->edittime );
+                       $db, $this->mArticle->mTitle, $this->edittime );
                if( is_null( $baseRevision ) ) {
                        wfProfileOut( $fname );
                        return false;
@@ -1584,7 +1567,7 @@ END
 
                // The current state, we want to merge updates into it
                $currentRevision =  Revision::loadFromTitle(
-                       $db, $this->dbTitle );
+                       $db, $this->mArticle->mTitle );
                if( is_null( $currentRevision ) ) {
                        wfProfileOut( $fname );
                        return false;
@@ -1946,7 +1929,7 @@ END
                $oldtitle = wfMsgExt( 'currentrev', array('parseinline') );
                $newtitle = wfMsgExt( 'yourtext', array('parseinline') );
                if ( $oldtext !== false  || $newtext != '' ) {
-                       $de = new DifferenceEngine( $this->dbTitle );
+                       $de = new DifferenceEngine( $this->mTitle );
                        $de->setText( $oldtext, $newtext );
                        $difftext = $de->getDiff( $oldtitle, $newtitle );
                        $de->showDiffStyle();
@@ -2086,7 +2069,7 @@ END
         * @param OutputPage $out
         */
        private function showDeletionLog( $out ) {
-               $title = $this->dbTitle;
+               $title = $this->mArticle->getTitle();
                $reader = new LogReader(
                        new FauxRequest(
                                array(
@@ -2113,11 +2096,6 @@ END
 
                $resultDetails = false;
                $value = $this->internalAttemptSave( $resultDetails );
-               
-               if( $value == self::AS_SUCCESS_UPDATE || $value = self::AS_SUCCESS_NEW_ARTICLE ) {
-                       $this->didSave = true;
-               }
-               
                switch ($value)
                {
                        case self::AS_HOOK_ERROR_EXPECTED:
@@ -2162,7 +2140,7 @@ END
                                return;
                        
                        case self::AS_BLANK_ARTICLE:
-                               $wgOut->redirect( $this->uiTitle->getFullURL() );
+                               $wgOut->redirect( $this->mTitle->getFullURL() );
                                return false;
                }
        }