removed trailing spaces
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 23 Oct 2009 11:08:08 +0000 (11:08 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 23 Oct 2009 11:08:08 +0000 (11:08 +0000)
includes/EditPage.php

index 7d4fccd..8df6a14 100644 (file)
@@ -112,7 +112,7 @@ class EditPage {
                $this->previewTextAfterContent =
                $this->mPreloadText = "";
        }
-       
+
        function getArticle() {
                return $this->mArticle;
        }
@@ -173,7 +173,7 @@ class EditPage {
                                        $undorev->getPage() == $this->mArticle->getID() &&
                                        !$undorev->isDeleted( Revision::DELETED_TEXT ) &&
                                        !$oldrev->isDeleted( Revision::DELETED_TEXT ) ) {
-                                       
+
                                        $undotext = $this->mArticle->getUndoText( $undorev, $oldrev );
                                        if ( $undotext === false ) {
                                                # Warn the user that something went wrong
@@ -208,7 +208,7 @@ class EditPage {
                wfProfileOut( __METHOD__ );
                return $text;
        }
-       
+
        /** Use this method before edit() to preload some text into the edit box */
        public function setPreloadedText( $text ) {
                $this->mPreloadText = $text;
@@ -330,7 +330,7 @@ class EditPage {
                $this->mMetaData = $s;
        }
 
-       /* 
+       /*
         * Check if a page was deleted while the user was editing it, before submit.
         * Note that we rely on the logging table, which hasn't been always there,
         * but that doesn't matter, because this only applies to brand new
@@ -422,7 +422,7 @@ class EditPage {
                                }
                        }
                }
-               
+
                // If they used redlink=1 and the page exists, redirect to the main article
                if ( $wgRequest->getBool( 'redlink' ) && $this->mTitle->exists() ) {
                        $wgOut->redirect( $this->mTitle->getFullURL() );
@@ -491,7 +491,7 @@ class EditPage {
                wfProfileOut( __METHOD__."-business-end" );
                wfProfileOut( __METHOD__ );
        }
-       
+
        protected function getEditPermissionErrors() {
                global $wgUser;
                $permErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser );
@@ -503,7 +503,7 @@ class EditPage {
                # Ignore some permissions errors when a user is just previewing/viewing diffs
                $remove = array();
                foreach( $permErrors as $error ) {
-                       if ( ($this->preview || $this->diff) && 
+                       if ( ($this->preview || $this->diff) &&
                                ($error[0] == 'blockedtext' || $error[0] == 'autoblockedtext') )
                        {
                                $remove[] = $error;
@@ -632,8 +632,8 @@ 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->mTitle->mNamespace == NS_USER || $this->mTitle->mNamespace == NS_USER_TALK ) && 
-                               $this->mTitle->getText() == $wgUser->getName() ) 
+                       if ( ( $this->mTitle->mNamespace == NS_USER || $this->mTitle->mNamespace == NS_USER_TALK ) &&
+                               $this->mTitle->getText() == $wgUser->getName() )
                        {
                                $this->allowBlankSummary = true;
                        } else {
@@ -664,7 +664,7 @@ class EditPage {
                        elseif ( $this->section != 'new' && $request->getVal( 'summary' ) ) {
                                $this->summary = $request->getText( 'summary' );
                        }
-                       
+
                        if ( $request->getVal( 'minor' ) ) {
                                $this->minoredit = true;
                        }
@@ -734,11 +734,11 @@ class EditPage {
                }
                # Give a notice if the user is editing a deleted/moved page...
                if ( !$this->mTitle->exists() ) {
-                       LogEventsList::showLogExtract( $wgOut, array( 'delete', 'move' ), $this->mTitle->getPrefixedText(), 
-                               '', array( 'lim' => 10, 
-                                          'conds' => array( "log_action != 'revision'" ), 
-                                          'showIfEmpty' => false, 
-                                          'msgKey' => array( 'recreate-moveddeleted-warn') ) 
+                       LogEventsList::showLogExtract( $wgOut, array( 'delete', 'move' ), $this->mTitle->getPrefixedText(),
+                               '', array( 'lim' => 10,
+                                          'conds' => array( "log_action != 'revision'" ),
+                                          'showIfEmpty' => false,
+                                          'msgKey' => array( 'recreate-moveddeleted-warn') )
                        );
                }
        }
@@ -904,7 +904,7 @@ class EditPage {
                                wfProfileOut( $fname );
                                return self::AS_HOOK_ERROR_EXPECTED;
                        }
-                       
+
                        # Handle the user preference to force summaries here. Check if it's not a redirect.
                        if ( !$this->allowBlankSummary && !Title::newFromRedirect( $this->textbox1 ) ) {
                                if ( md5( $this->summary ) == $this->autoSumm ) {
@@ -947,7 +947,7 @@ class EditPage {
                        }
                }
                $userid = $wgUser->getId();
-               
+
                # Suppress edit conflict with self, except for section edits where merging is required.
                if ( $this->isConflict && $this->section == '' && $this->userWasLastToEdit($userid,$this->edittime) ) {
                        wfDebug( "EditPage::editForm Suppressing edit conflict, same user.\n" );
@@ -998,7 +998,7 @@ class EditPage {
                }
 
                # Handle the user preference to force summaries here, but not for null edits
-               if ( $this->section != 'new' && !$this->allowBlankSummary && 0 != strcmp($oldtext,$text) 
+               if ( $this->section != 'new' && !$this->allowBlankSummary && 0 != strcmp($oldtext,$text)
                        && !Title::newFromRedirect( $text ) ) # check if it's not a redirect
                {
                        if ( md5( $this->summary ) == $this->autoSumm ) {
@@ -1062,7 +1062,7 @@ class EditPage {
 
                # update the article here
                if ( $this->mArticle->updateArticle( $text, $this->summary, $this->minoredit,
-                       $this->watchthis, $bot, $sectionanchor ) ) 
+                       $this->watchthis, $bot, $sectionanchor ) )
                {
                        wfProfileOut( $fname );
                        return self::AS_SUCCESS_UPDATE;
@@ -1072,7 +1072,7 @@ class EditPage {
                wfProfileOut( $fname );
                return self::AS_END;
        }
-       
+
        /**
         * Check if no edits were made by other users since
         * the time a user started editing the page. Limit to
@@ -1083,7 +1083,7 @@ class EditPage {
                $dbw = wfGetDB( DB_MASTER );
                $res = $dbw->select( 'revision',
                        'rev_user',
-                       array( 
+                       array(
                                'rev_page' => $this->mArticle->getId(),
                                'rev_timestamp > '.$dbw->addQuotes( $dbw->timestamp($edittime) )
                        ),
@@ -1107,7 +1107,7 @@ class EditPage {
                $regexes = (array)$wgSpamRegex;
                return self::matchSpamRegexInternal( $text, $regexes );
        }
-       
+
        /**
         * Check given input text against $wgSpamRegex, and return the text of the first match.
         * @return mixed -- matching string or false
@@ -1117,7 +1117,7 @@ class EditPage {
                $regexes = (array)$wgSummarySpamRegex;
                return self::matchSpamRegexInternal( $text, $regexes );
        }
-       
+
        protected static function matchSpamRegexInternal( $text, $regexes ) {
                foreach( $regexes as $regex ) {
                        $matches = array();
@@ -1192,8 +1192,8 @@ class EditPage {
                if ( $this->formtype == 'preview' ) {
                        $previewOutput = $this->getPreviewText();
                }
-               
-               wfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) ) ;
+
+               wfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) );
 
                $this->setHeaders();
 
@@ -1289,7 +1289,7 @@ class EditPage {
                                $noticeMsg = 'protectedpagewarning';
                                $classes[] = 'mw-textarea-protected';
                        }
-                       LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '', 
+                       LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '',
                                array( 'lim' => 1, 'msgKey' => array( $noticeMsg ) ) );
                }
                if ( $this->mTitle->isCascadeProtected() ) {
@@ -1551,7 +1551,7 @@ END
 END
 );
                $this->showTextbox1( $classes );
-               
+
                $wgOut->addHTML( $this->editFormTextAfterContent );
 
                $wgOut->wrapWikiMsg( "<div id=\"editpage-copywarn\">\n$1\n</div>", $copywarnMsg );
@@ -1628,25 +1628,25 @@ END
 <input type='hidden' value=\"{$this->edittime}\" name=\"wpEdittime\" />\n
 <input type='hidden' value=\"{$this->scrolltop}\" name=\"wpScrolltop\" id=\"wpScrolltop\" />\n" );
        }
-       
+
        protected function showTextbox1( $classes ) {
                $attribs = array( 'tabindex' => 1 );
-               
+
                if ( $this->wasDeletedSinceLastEdit() )
                        $attribs['type'] = 'hidden';
                if ( !empty($classes) )
                        $attribs['class'] = implode(' ',$classes);
-               
+
                $this->showTextbox( $this->textbox1, 'wpTextbox1', $attribs );
        }
-       
+
        protected function showTextbox2() {
                $this->showTextbox( $this->textbox2, 'wpTextbox2', array( 'tabindex' => 6 ) );
        }
-       
+
        protected function showTextbox( $content, $name, $attribs = array() ) {
                global $wgOut, $wgUser;
-               
+
                $wikitext = $this->safeUnicodeOutput( $content );
                if ( $wikitext !== '' ) {
                        // Ensure there's a newline at the end, otherwise adding lines
@@ -1655,13 +1655,13 @@ END
                        // mode will show an extra newline. A bit annoying.
                        $wikitext .= "\n";
                }
-               
+
                $attribs['accesskey'] = ',';
                $attribs['id'] = $name;
-               
+
                if ( $wgUser->getOption( 'editwidth' ) )
                        $attribs['style'] = 'width: 100%';
-               
+
                $wgOut->addHTML( Xml::textarea(
                        $name,
                        $wikitext,
@@ -1766,7 +1766,7 @@ END
                               'log_title',
                               'log_comment',
                               'log_params',
-                                  'log_deleted',
+                              'log_deleted',
                               'user_name' ),
                        array( 'log_namespace' => $this->mTitle->getNamespace(),
                               'log_title' => $this->mTitle->getDBkey(),
@@ -1878,7 +1878,7 @@ END
                wfProfileOut( __METHOD__ );
                return $previewhead . $previewHTML . $this->previewTextAfterContent;
        }
-       
+
        function getTemplates() {
                if ( $this->preview || $this->section != '' ) {
                        $templates = array();
@@ -2065,7 +2065,7 @@ END
         * Shows a bulletin board style toolbar for common editing functions.
         * It can be disabled in the user preferences.
         * The necessary JavaScript code can be found in skins/common/edit.js.
-        * 
+        *
         * @return string
         */
        static function getEditToolbar() {
@@ -2283,7 +2283,7 @@ END
                ++$tabindex; // use the same for preview and live preview
                if ( $this->useLivePreview() ) {
                        $this->doLivePreviewScript(); // Add to output
-                       
+
                        $temp = array(
                                'id'        => 'wpPreview',
                                'name'      => 'wpPreview',
@@ -2305,7 +2305,7 @@ END
                                'title'     => '',
                                'style'     => 'display: none;',
                        );
-                       
+
                        $buttons['live'] = Xml::element('input', $temp, '');
                } else {
                        $temp = array(
@@ -2601,7 +2601,7 @@ END
                                return false;
                }
        }
-       
+
        function getBaseRevision() {
                if ( $this->mBaseRevision == false ) {
                        $db = wfGetDB( DB_MASTER );