fix some spacing
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 28 Jan 2013 21:11:10 +0000 (22:11 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 31 Jan 2013 20:06:37 +0000 (20:06 +0000)
Change-Id: I2a59eb22bb8acf01b560507a48d6be55d9c87de7

20 files changed:
includes/specials/SpecialAllpages.php
includes/specials/SpecialBlock.php
includes/specials/SpecialChangeEmail.php
includes/specials/SpecialChangePassword.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialDoubleRedirects.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialImport.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialSearch.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUploadStash.php
includes/specials/SpecialUserrights.php
includes/specials/SpecialVersion.php
includes/specials/SpecialWhatlinkshere.php

index abfb719..df65e4a 100644 (file)
@@ -188,10 +188,10 @@ class SpecialAllpages extends IncludableSpecialPage {
                $from = ( $from && $from->isLocal() ) ? $from->getDBkey() : null;
                $to = ( $to && $to->isLocal() ) ? $to->getDBkey() : null;
 
-               if( isset($from) )
-                       $where[] = 'page_title >= '.$dbr->addQuotes( $from );
-               if( isset($to) )
-                       $where[] = 'page_title <= '.$dbr->addQuotes( $to );
+               if( isset( $from ) )
+                       $where[] = 'page_title >= ' . $dbr->addQuotes( $from );
+               if( isset( $to ) )
+                       $where[] = 'page_title <= ' . $dbr->addQuotes( $to );
 
                global $wgMemc;
                $key = wfMemcKey( 'allpages', 'ns', $namespace, $from, $to );
@@ -217,9 +217,9 @@ class SpecialAllpages extends IncludableSpecialPage {
                                        : array( 'page_title >= ' . $dbr->addQuotes( $lastTitle ) );
                                $res = $dbr->select( 'page', /* FROM */
                                        'page_title', /* WHAT */
-                                       array_merge($where,$chunk),
+                                       array_merge( $where, $chunk ),
                                        __METHOD__,
-                                       array ('LIMIT' => 2, 'OFFSET' => $maxPerSubpage - 1, 'ORDER BY' => 'page_title ASC')
+                                       array( 'LIMIT' => 2, 'OFFSET' => $maxPerSubpage - 1, 'ORDER BY' => 'page_title ASC' )
                                );
 
                                $s = $dbr->fetchObject( $res );
@@ -228,7 +228,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                } else {
                                        // Final chunk, but ended prematurely. Go back and find the end.
                                        $endTitle = $dbr->selectField( 'page', 'MAX(page_title)',
-                                               array_merge($where,$chunk),
+                                               array_merge( $where, $chunk ),
                                                __METHOD__ );
                                        array_push( $lines, $endTitle );
                                        $done = true;
@@ -272,7 +272,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                if( $this->including() ) {
                        $out2 = '';
                } else {
-                       if( isset($from) || isset($to) ) {
+                       if( isset( $from ) || isset( $to ) ) {
                                $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ).
                                                '<tr>
                                                        <td>' .
@@ -311,12 +311,12 @@ class SpecialAllpages extends IncludableSpecialPage {
                $queryparams = $namespace ? "namespace=$namespace&" : '';
 
                $queryhideredirects = array();
-               if ($hideredirects) {
+               if ( $hideredirects ) {
                        $queryhideredirects[ 'hideredirects' ] = 1;
                }
 
                $special = $this->getTitle();
-               $link = htmlspecialchars( $special->getLocalUrl( $queryparams . 'from=' . urlencode($inpoint) . '&to=' . urlencode($outpoint), $queryhideredirects ) );
+               $link = htmlspecialchars( $special->getLocalUrl( $queryparams . 'from=' . urlencode( $inpoint ) . '&to=' . urlencode( $outpoint ), $queryhideredirects ) );
 
                $out = $this->msg( 'alphaindexline' )->rawParams(
                        "<a href=\"$link\">$inpointf</a></td><td>",
@@ -335,7 +335,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                global $wgContLang;
                $output = $this->getOutput();
 
-               $fromList = $this->getNamespaceKeyAndText($namespace, $from);
+               $fromList = $this->getNamespaceKeyAndText( $namespace, $from );
                $toList = $this->getNamespaceKeyAndText( $namespace, $to );
                $namespaces = $wgContLang->getNamespaces();
                $n = 0;
@@ -416,10 +416,10 @@ class SpecialAllpages extends IncludableSpecialPage {
                                $res_prev = $dbr->select(
                                        'page',
                                        'page_title',
-                                       array( 'page_namespace' => $namespace, 'page_title < '.$dbr->addQuotes($from) ),
+                                       array( 'page_namespace' => $namespace, 'page_title < ' . $dbr->addQuotes( $from ) ),
                                        __METHOD__,
                                        array( 'ORDER BY' => 'page_title DESC',
-                                               'LIMIT' => $this->maxPerPage, 'OFFSET' => ($this->maxPerPage - 1 )
+                                               'LIMIT' => $this->maxPerPage, 'OFFSET' => ( $this->maxPerPage - 1 )
                                        )
                                );
 
@@ -438,7 +438,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                                array( 'page_namespace' => $namespace ), __METHOD__, $options );
                                        # Show the previous link if it s not the current requested chunk
                                        if( $from != $reallyFirstPage_title ) {
-                                               $prevTitle =  Title::makeTitle( $namespace, $reallyFirstPage_title );
+                                               $prevTitle = Title::makeTitle( $namespace, $reallyFirstPage_title );
                                        } else {
                                                $prevTitle = null;
                                        }
@@ -477,7 +477,7 @@ class SpecialAllpages extends IncludableSpecialPage {
 
                        if( $n == $this->maxPerPage && $s = $res->fetchObject() ) {
                                # $s is the first link of the next chunk
-                               $t = Title::makeTitle($namespace, $s->page_title);
+                               $t = Title::makeTitle( $namespace, $s->page_title );
                                $query = array( 'from' => $t->getText() );
 
                                if( $namespace )
@@ -518,11 +518,11 @@ class SpecialAllpages extends IncludableSpecialPage {
         * @param $text String: the name of the article
         * @return array( int namespace, string dbkey, string pagename ) or NULL on error
         */
-       protected function getNamespaceKeyAndText($ns, $text) {
+       protected function getNamespaceKeyAndText( $ns, $text ) {
                if ( $text == '' )
                        return array( $ns, '', '' ); # shortcut for common case
 
-               $t = Title::makeTitleSafe($ns, $text);
+               $t = Title::makeTitleSafe( $ns, $text );
                if ( $t && $t->isLocal() ) {
                        return array( $t->getNamespace(), $t->getDBkey(), $t->getText() );
                } elseif ( $t ) {
@@ -530,8 +530,8 @@ class SpecialAllpages extends IncludableSpecialPage {
                }
 
                # try again, in case the problem was an empty pagename
-               $text = preg_replace('/(#|$)/', 'X$1', $text);
-               $t = Title::makeTitleSafe($ns, $text);
+               $text = preg_replace( '/(#|$)/', 'X$1', $text );
+               $t = Title::makeTitleSafe( $ns, $text );
                if ( $t && $t->isLocal() ) {
                        return array( $t->getNamespace(), '', '' );
                } else {
index ec026e8..b71588d 100644 (file)
@@ -386,7 +386,7 @@ class SpecialBlock extends FormSpecialPage {
                        );
                }
 
-               $text =  Html::rawElement(
+               $text = Html::rawElement(
                        'p',
                        array( 'class' => 'mw-ipb-conveniencelinks' ),
                        $this->getLanguage()->pipeList( $links )
@@ -650,7 +650,7 @@ class SpecialBlock extends FormSpecialPage {
                }
 
                if ( $data['HideUser'] ) {
-                       if ( !$performer->isAllowed('hideuser') ) {
+                       if ( !$performer->isAllowed( 'hideuser' ) ) {
                                # this codepath is unreachable except by a malicious user spoofing forms,
                                # or by race conditions (user has oversight and sysop, loads block form,
                                # and is de-oversighted before submission); so need to fail completely
index eae8e3a..53faba7 100644 (file)
@@ -195,7 +195,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
                        if ( $type != 'text' ) {
                                $out .= Xml::label( $this->msg( $label )->text(), $name );
                        } else {
-                               $out .=  $this->msg( $label )->escaped();
+                               $out .= $this->msg( $label )->escaped();
                        }
                        $out .= "</td>\n";
                        $out .= "\t<td class='mw-input'>";
index 54a2771..6280eb4 100644 (file)
@@ -112,7 +112,7 @@ class SpecialChangePassword extends UnlistedSpecialPage {
         * @param $msg string
         */
        function error( $msg ) {
-               $this->getOutput()->addHTML( Xml::element('p', array( 'class' => 'error' ), $msg ) );
+               $this->getOutput()->addHTML( Xml::element( 'p', array( 'class' => 'error' ), $msg ) );
        }
 
        function showForm() {
@@ -202,7 +202,7 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                        if ( $type != 'text' )
                                $out .= Xml::label( $this->msg( $label )->text(), $name );
                        else
-                               $out .=  $this->msg( $label )->escaped();
+                               $out .= $this->msg( $label )->escaped();
                        $out .= "</td>\n";
                        $out .= "\t<td class='mw-input'>";
                        $out .= $field;
@@ -231,7 +231,7 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                        throw new PasswordError( $this->msg( 'login-throttled' )->text() );
                }
 
-               if( !$user->checkTemporaryPassword($this->mOldpass) && !$user->checkPassword($this->mOldpass) ) {
+               if( !$user->checkTemporaryPassword( $this->mOldpass ) && !$user->checkPassword( $this->mOldpass ) ) {
                        wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'wrongpassword' ) );
                        throw new PasswordError( $this->msg( 'resetpass-wrong-oldpass' )->text() );
                }
index bdeb7fe..0c934a4 100644 (file)
@@ -168,7 +168,7 @@ class DeletedContribsPager extends IndexPager {
 
                $user = $this->getUser();
 
-               if( $user->isAllowed('deletedtext') ) {
+               if( $user->isAllowed( 'deletedtext' ) ) {
                        $last = Linker::linkKnown(
                                $undelete,
                                $this->messages['diff'],
@@ -475,7 +475,7 @@ class DeletedContributionsPage extends SpecialPage {
                if ( !isset( $options['target'] ) ) {
                        $options['target'] = '';
                } else {
-                       $options['target'] = str_replace( '_' , ' ' , $options['target'] );
+                       $options['target'] = str_replace( '_', ' ', $options['target'] );
                }
 
                if ( !isset( $options['namespace'] ) ) {
@@ -499,7 +499,7 @@ class DeletedContributionsPage extends SpecialPage {
                        $f .= "\t" . Html::hidden( $name, $value ) . "\n";
                }
 
-               $f .=  Xml::openElement( 'fieldset' ) .
+               $f .= Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', array(), $this->msg( 'sp-contributions-search' )->text() ) .
                        Xml::tags( 'label', array( 'for' => 'target' ), $this->msg( 'sp-contributions-username' )->parse() ) . ' ' .
                        Html::input( 'target', $options['target'], 'text', array(
index ee07323..9c47554 100644 (file)
@@ -117,7 +117,7 @@ class DoubleRedirectsPage extends QueryPage {
                        $dbr = wfGetDB( DB_SLAVE );
                        $qi = $this->reallyGetQueryInfo( $result->namespace,
                                        $result->title );
-                       $res = $dbr->select($qi['tables'], $qi['fields'],
+                       $res = $dbr->select( $qi['tables'], $qi['fields'],
                                        $qi['conds'], __METHOD__ );
                        if ( $res ) {
                                $result = $dbr->fetchObject( $res );
@@ -128,7 +128,7 @@ class DoubleRedirectsPage extends QueryPage {
                }
 
                $titleB = Title::makeTitle( $result->nsb, $result->tb );
-               $titleC = Title::makeTitle( $result->nsc, $result->tc, '',  $result->iwc );
+               $titleC = Title::makeTitle( $result->nsc, $result->tc, '', $result->iwc );
 
                $linkA = Linker::linkKnown(
                        $titleA,
index 6d5205a..40971c7 100644 (file)
@@ -289,7 +289,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
 
                $res = $dbr->select(
                        array( 'watchlist' ),
-                       array( 'wl_namespace',  'wl_title' ),
+                       array( 'wl_namespace', 'wl_title' ),
                        array( 'wl_user' => $this->getUser()->getId() ),
                        __METHOD__,
                        array( 'ORDER BY' => array( 'wl_namespace', 'wl_title' ) )
@@ -478,7 +478,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
 
                foreach( $this->getWatchlistInfo() as $namespace => $pages ) {
                        if ( $namespace >= 0 ) {
-                               $fields['TitlesNs'.$namespace] = array(
+                               $fields['TitlesNs' . $namespace] = array(
                                        'class' => 'EditWatchlistCheckboxSeriesField',
                                        'options' => array(),
                                        'section' => "ns$namespace",
@@ -489,7 +489,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                $title = Title::makeTitleSafe( $namespace, $dbkey );
                                if ( $this->checkTitle( $title, $namespace, $dbkey ) ) {
                                        $text = $this->buildRemoveLine( $title );
-                                       $fields['TitlesNs'.$namespace]['options'][$text] = $title->getPrefixedText();
+                                       $fields['TitlesNs' . $namespace]['options'][$text] = $title->getPrefixedText();
                                        $count++;
                                }
                        }
@@ -519,7 +519,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                $form->setTitle( $this->getTitle() );
                $form->setSubmitTextMsg( 'watchlistedit-normal-submit' );
                # Used message keys: 'accesskey-watchlistedit-normal-submit', 'tooltip-watchlistedit-normal-submit'
-               $form->setSubmitTooltip('watchlistedit-normal-submit');
+               $form->setSubmitTooltip( 'watchlistedit-normal-submit' );
                $form->setWrapperLegendMsg( 'watchlistedit-normal-legend' );
                $form->addHeaderText( $this->msg( 'watchlistedit-normal-explain' )->parse() );
                $form->setSubmitCallback( array( $this, 'submitNormal' ) );
@@ -577,7 +577,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                $form->setTitle( $this->getTitle( 'raw' ) );
                $form->setSubmitTextMsg( 'watchlistedit-raw-submit' );
                # Used message keys: 'accesskey-watchlistedit-raw-submit', 'tooltip-watchlistedit-raw-submit'
-               $form->setSubmitTooltip('watchlistedit-raw-submit');
+               $form->setSubmitTooltip( 'watchlistedit-raw-submit' );
                $form->setWrapperLegendMsg( 'watchlistedit-raw-legend' );
                $form->addHeaderText( $this->msg( 'watchlistedit-raw-explain' )->parse() );
                $form->setSubmitCallback( array( $this, 'submitRaw' ) );
index 96739ea..366aa81 100644 (file)
@@ -101,7 +101,7 @@ class FileDuplicateSearchPage extends QueryPage {
                $this->setHeaders();
                $this->outputHeader();
 
-               $this->filename =  isset( $par ) ?  $par : $this->getRequest()->getText( 'filename' );
+               $this->filename = isset( $par ) ?  $par : $this->getRequest()->getText( 'filename' );
                $this->file = null;
                $this->hash = '';
                $title = Title::newFromText( $this->filename, NS_FILE );
index 7247470..9fb0f9e 100644 (file)
@@ -410,7 +410,7 @@ class ImportReporter extends ContextSource {
                                $detail = $this->msg( 'import-logentry-upload-detail' )->numParams(
                                        $successCount )->inContentLanguage()->text();
                                if ( $this->reason ) {
-                                       $detail .=  $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
+                                       $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
                                }
                                $log->addEntry( 'upload', $title, $detail );
                        } else {
@@ -419,7 +419,7 @@ class ImportReporter extends ContextSource {
                                $detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams(
                                        $successCount )->params( $interwiki )->inContentLanguage()->text();
                                if ( $this->reason ) {
-                                       $detail .=  $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
+                                       $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason;
                                }
                                $log->addEntry( 'interwiki', $title, $detail );
                        }
@@ -428,7 +428,7 @@ class ImportReporter extends ContextSource {
                        $dbw = wfGetDB( DB_MASTER );
                        $latest = $title->getLatestRevID();
                        $nullRevision = Revision::newNullRevision( $dbw, $title->getArticleID(), $comment, true );
-                       if (!is_null($nullRevision)) {
+                       if ( !is_null( $nullRevision ) ) {
                                $nullRevision->insertOn( $dbw );
                                $page = WikiPage::factory( $title );
                                # Update page record
index d9d6a79..053c015 100644 (file)
@@ -105,7 +105,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                        }
                        // PG offsets not just digits!
                        if ( preg_match( '/^offset=([^=]+)$/', $bit, $m ) ) {
-                               $this->opts->setValue( 'offset',  intval( $m[1] ) );
+                               $this->opts->setValue( 'offset', intval( $m[1] ) );
                        }
                        if ( preg_match( '/^username=(.*)$/', $bit, $m ) ) {
                                $this->opts->setValue( 'username', $m[1] );
@@ -113,7 +113,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                        if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) {
                                $ns = $this->getLanguage()->getNsIndex( $m[1] );
                                if( $ns !== false ) {
-                                       $this->opts->setValue( 'namespace',  $ns );
+                                       $this->opts->setValue( 'namespace', $ns );
                                }
                        }
                }
index f3895e8..f486ea8 100644 (file)
@@ -145,8 +145,8 @@ class SpecialPrefixindex extends SpecialAllpages {
                        $from = $prefix;
                }
 
-               $fromList = $this->getNamespaceKeyAndText($namespace, $from);
-               $prefixList = $this->getNamespaceKeyAndText($namespace, $prefix);
+               $fromList = $this->getNamespaceKeyAndText( $namespace, $from );
+               $prefixList = $this->getNamespaceKeyAndText( $namespace, $prefix );
                $namespaces = $wgContLang->getNamespaces();
 
                if ( !$prefixList || !$fromList ) {
@@ -227,7 +227,7 @@ class SpecialPrefixindex extends SpecialAllpages {
                } else {
                        $nsForm = $this->namespacePrefixForm( $namespace, $prefix, $hideredirects );
                        $self = $this->getTitle();
-                       $out2 = Xml::openElement( 'table', array( 'id' => 'mw-prefixindex-nav-table' ) )  .
+                       $out2 = Xml::openElement( 'table', array( 'id' => 'mw-prefixindex-nav-table' ) ) .
                                '<tr>
                                        <td>' .
                                                $nsForm .
index 6502c72..cd1d256 100644 (file)
@@ -42,16 +42,16 @@ class SpecialRecentChanges extends IncludableSpecialPage {
        public function getDefaultOptions() {
                $opts = new FormOptions();
 
-               $opts->add( 'days',  (int)$this->getUser()->getOption( 'rcdays' ) );
+               $opts->add( 'days', (int)$this->getUser()->getOption( 'rcdays' ) );
                $opts->add( 'limit', (int)$this->getUser()->getOption( 'rclimit' ) );
                $opts->add( 'from', '' );
 
-               $opts->add( 'hideminor',     $this->getUser()->getBoolOption( 'hideminor' ) );
-               $opts->add( 'hidebots',      true  );
-               $opts->add( 'hideanons',     false );
-               $opts->add( 'hideliu',       false );
+               $opts->add( 'hideminor', $this->getUser()->getBoolOption( 'hideminor' ) );
+               $opts->add( 'hidebots', true  );
+               $opts->add( 'hideanons', false );
+               $opts->add( 'hideliu', false );
                $opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'hidepatrolled' ) );
-               $opts->add( 'hidemyself',    false );
+               $opts->add( 'hidemyself', false );
 
                $opts->add( 'namespace', '', FormOptions::INTNULL );
                $opts->add( 'invert', false );
@@ -232,7 +232,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        }
 
                        if( is_numeric( $bit ) ) {
-                               $opts['limit'] =  $bit;
+                               $opts['limit'] = $bit;
                        }
 
                        $m = array();
@@ -296,7 +296,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $cutoff_unixtime = $cutoff_unixtime - ($cutoff_unixtime % 86400);
                $cutoff = $dbr->timestamp( $cutoff_unixtime );
 
-               $fromValid = preg_match('/^[0-9]{14}$/', $opts['from']);
+               $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] );
                if( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) {
                        $cutoff = $dbr->timestamp( $opts['from'] );
                } else {
@@ -387,7 +387,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $tables[] = 'watchlist';
                        $fields[] = 'wl_user';
                        $fields[] = 'wl_notificationtimestamp';
-                       $join_conds['watchlist'] = array('LEFT JOIN', array(
+                       $join_conds['watchlist'] = array( 'LEFT JOIN', array(
                                'wl_user' => $uid,
                                'wl_title=rc_title',
                                'wl_namespace=rc_namespace'
@@ -396,7 +396,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                if ( $this->getUser()->isAllowed( 'rollback' ) ) {
                        $tables[] = 'page';
                        $fields[] = 'page_latest';
-                       $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id');
+                       $join_conds['page'] = array( 'LEFT JOIN', 'rc_cur_id=page_id' );
                }
                // Tag stuff.
                ChangeTags::modifyDisplayQuery(
index 3dae3a7..6d7173b 100644 (file)
@@ -110,7 +110,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                }
                if ( $this->getUser()->isAllowed( 'rollback' ) ) {
                        $tables[] = 'page';
-                       $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id');
+                       $join_conds['page'] = array( 'LEFT JOIN', 'rc_cur_id=page_id' );
                        $select[] = 'page_latest';
                }
                ChangeTags::modifyDisplayQuery(
@@ -204,15 +204,15 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                        $subsql[] = $query;
                }
 
-               if( count($subsql) == 0 ) {
+               if( count( $subsql ) == 0 ) {
                        return false; // should never happen
                }
-               if( count($subsql) == 1 && $dbr->unionSupportsOrderAndLimit() ) {
+               if( count( $subsql ) == 1 && $dbr->unionSupportsOrderAndLimit() ) {
                        $sql = $subsql[0];
                } else {
                        // need to resort and relimit after union
-                       $sql = $dbr->unionQueries($subsql, false).' ORDER BY rc_timestamp DESC';
-                       $sql = $dbr->limitResult($sql, $limit, false);
+                       $sql = $dbr->unionQueries( $subsql, false ) . ' ORDER BY rc_timestamp DESC';
+                       $sql = $dbr->limitResult( $sql, $limit, false );
                }
 
                $res = $dbr->query( $sql, __METHOD__ );
@@ -237,7 +237,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                        Xml::check( 'showlinkedto', $opts['showlinkedto'], array( 'id' => 'showlinkedto' ) ) . ' ' .
                        Xml::label( $this->msg( 'recentchangeslinked-to' )->text(), 'showlinkedto' ) );
                $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] );
-               if ($tagFilter) {
+               if ( $tagFilter ) {
                        $extraOpts['tagfilter'] = $tagFilter;
                }
                return $extraOpts;
index eaf0d52..305d13b 100644 (file)
@@ -133,7 +133,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $this->ids = explode( ',', $ids );
                } else {
                        # Array input
-                       $this->ids = array_keys( $request->getArray('ids',array()) );
+                       $this->ids = array_keys( $request->getArray( 'ids', array() ) );
                }
                // $this->ids = array_map( 'intval', $this->ids );
                $this->ids = array_unique( array_filter( $this->ids ) );
@@ -191,7 +191,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
 
                $this->otherReason = $request->getVal( 'wpReason' );
                # We need a target page!
-               if( is_null($this->targetObj) ) {
+               if( is_null( $this->targetObj ) ) {
                        $output->addWikiMsg( 'undelete-header' );
                        return;
                }
@@ -204,7 +204,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ),
                        array( 'revdelete-hide-user', 'wpHideUser', Revision::DELETED_USER )
                );
-               if( $user->isAllowed('suppressrevision') ) {
+               if( $user->isAllowed( 'suppressrevision' ) ) {
                        $this->checks[] = array( 'revdelete-hide-restricted',
                                'wpHideRestricted', Revision::DELETED_RESTRICTED );
                }
@@ -225,7 +225,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                # Show relevant lines from the suppression log
                if( $user->isAllowed( 'suppressionlog' ) ) {
                        $suppressLogPage = new LogPage( 'suppress' );
-                       $output->addHTML( "<h2>" . $suppressLogPage->getName()->escaped()  . "</h2>\n" );
+                       $output->addHTML( "<h2>" . $suppressLogPage->getName()->escaped() . "</h2>\n" );
                        LogEventsList::showLogExtract( $output, 'suppress',
                                $this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
                }
@@ -253,7 +253,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                        array( 'action' => 'history' )
                                );
                                # Link to deleted edits
-                               if( $this->getUser()->isAllowed('undelete') ) {
+                               if( $this->getUser()->isAllowed( 'undelete' ) ) {
                                        $undelete = SpecialPage::getTitleFor( 'Undelete' );
                                        $links[] = Linker::linkKnown(
                                                $undelete,
@@ -356,7 +356,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $UserAllowed = true;
 
                if ( $this->typeName == 'logging' ) {
-                       $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLanguage()->formatNum( count($this->ids) ) );
+                       $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLanguage()->formatNum( count( $this->ids ) ) );
                } else {
                        $this->getOutput()->addWikiMsg( 'revdelete-selected',
                                $this->targetObj->getPrefixedText(), count( $this->ids ) );
@@ -522,7 +522,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         */
        protected function submit() {
                # Check edit token on submission
-               $token = $this->getRequest()->getVal('wpEditToken');
+               $token = $this->getRequest()->getVal( 'wpEditToken' );
                if( $this->submitClicked && !$this->getUser()->matchEditToken( $token ) ) {
                        $this->getOutput()->addWikiMsg( 'sessionfailure' );
                        return false;
@@ -537,7 +537,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $comment = $this->otherReason;
                }
                # Can the user set this field?
-               if( $bitParams[Revision::DELETED_RESTRICTED]==1 && !$this->getUser()->isAllowed('suppressrevision') ) {
+               if( $bitParams[Revision::DELETED_RESTRICTED] == 1 && !$this->getUser()->isAllowed( 'suppressrevision' ) ) {
                        throw new PermissionsError( 'suppressrevision' );
                }
                # If the save went through, go to success message...
@@ -586,7 +586,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        }
                        $bitfield[$field] = $val;
                }
-               if( !isset($bitfield[Revision::DELETED_RESTRICTED]) ) {
+               if( !isset( $bitfield[Revision::DELETED_RESTRICTED] ) ) {
                        $bitfield[Revision::DELETED_RESTRICTED] = 0;
                }
                return $bitfield;
@@ -624,4 +624,3 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                );
        }
 }
-
index 397a24f..823ecc9 100644 (file)
@@ -138,7 +138,7 @@ class SpecialSearch extends SpecialPage {
                        // BC with old request format
                        $profile = 'advanced';
                        foreach( $profiles as $key => $data ) {
-                               if ( $nslist === $data['namespaces'] && $key !== 'advanced') {
+                               if ( $nslist === $data['namespaces'] && $key !== 'advanced' ) {
                                        $profile = $key;
                                }
                        }
@@ -159,7 +159,7 @@ class SpecialSearch extends SpecialPage {
                $default = $request->getBool( 'profile' ) ? 0 : 1;
                $this->searchRedirects = $request->getBool( 'redirs', $default ) ? 1 : 0;
                $this->didYouMeanHtml = ''; # html of did you mean... link
-               $this->fulltext = $request->getVal('fulltext');
+               $this->fulltext = $request->getVal( 'fulltext' );
                $this->profile = $profile;
        }
 
@@ -218,7 +218,7 @@ class SpecialSearch extends SpecialPage {
                $search->showRedirects = $this->searchRedirects; // BC
                $search->setFeatureData( 'list-redirects', $this->searchRedirects );
                $search->prefix = $this->mPrefix;
-               $term = $search->transformSearchTerm($term);
+               $term = $search->transformSearchTerm( $term );
 
                wfRunHooks( 'SpecialSearchSetupEngine', array( $this, $this->profile, $search ) );
 
@@ -250,7 +250,7 @@ class SpecialSearch extends SpecialPage {
                $t = Title::newFromText( $term );
 
                // fetch search results
-               $rewritten = $search->replacePrefixes($term);
+               $rewritten = $search->replacePrefixes( $term );
 
                $titleMatches = $search->searchTitle( $rewritten );
                if( !( $titleMatches instanceof SearchResultTooMany ) ) {
@@ -311,9 +311,9 @@ class SpecialSearch extends SpecialPage {
                        Xml::openElement( 'tr' ) .
                        Xml::openElement( 'td' ) . "\n" .
                        $this->shortDialog( $term ) .
-                       Xml::closeElement('td') .
-                       Xml::closeElement('tr') .
-                       Xml::closeElement('table')
+                       Xml::closeElement( 'td' ) .
+                       Xml::closeElement( 'tr' ) .
+                       Xml::closeElement( 'table' )
                );
 
                // Sometimes the search engine knows there are too many hits
@@ -323,7 +323,7 @@ class SpecialSearch extends SpecialPage {
                        return;
                }
 
-               $filePrefix = $wgContLang->getFormattedNsText(NS_FILE).':';
+               $filePrefix = $wgContLang->getFormattedNsText( NS_FILE ) . ':';
                if( trim( $term ) === '' || $filePrefix === trim( $term ) ) {
                        $out->addHTML( $this->formHeader( $term, 0, 0 ) );
                        $out->addHtml( $this->getProfileForm( $this->profile, $term ) );
@@ -347,9 +347,9 @@ class SpecialSearch extends SpecialPage {
 
                // get total number of results if backend can calculate it
                $totalRes = 0;
-               if($titleMatches && !is_null( $titleMatches->getTotalHits() ) )
+               if( $titleMatches && !is_null( $titleMatches->getTotalHits() ) )
                        $totalRes += $titleMatches->getTotalHits();
-               if($textMatches && !is_null( $textMatches->getTotalHits() ))
+               if( $textMatches && !is_null( $textMatches->getTotalHits() ) )
                        $totalRes += $textMatches->getTotalHits();
 
                // show number of results and current offset
@@ -516,7 +516,7 @@ class SpecialSearch extends SpecialPage {
 
                $out = "";
                $infoLine = $matches->getInfo();
-               if( !is_null($infoLine) ) {
+               if( !is_null( $infoLine ) ) {
                        $out .= "\n<!-- {$infoLine} -->\n";
                }
                $out .= "<ul class='mw-search-results'>\n";
@@ -551,7 +551,7 @@ class SpecialSearch extends SpecialPage {
 
                $t = $result->getTitle();
 
-               $titleSnippet = $result->getTitleSnippet($terms);
+               $titleSnippet = $result->getTitleSnippet( $terms );
 
                if( $titleSnippet == '' )
                        $titleSnippet = null;
@@ -584,12 +584,12 @@ class SpecialSearch extends SpecialPage {
 
                // format redirects / relevant sections
                $redirectTitle = $result->getRedirectTitle();
-               $redirectText = $result->getRedirectSnippet($terms);
+               $redirectText = $result->getRedirectSnippet( $terms );
                $sectionTitle = $result->getSectionTitle();
-               $sectionText = $result->getSectionSnippet($terms);
+               $sectionText = $result->getSectionSnippet( $terms );
                $redirect = '';
 
-               if( !is_null($redirectTitle) ) {
+               if( !is_null( $redirectTitle ) ) {
                        if( $redirectText == '' )
                                $redirectText = null;
 
@@ -601,7 +601,7 @@ class SpecialSearch extends SpecialPage {
 
                $section = '';
 
-               if( !is_null($sectionTitle) ) {
+               if( !is_null( $sectionTitle ) ) {
                        if( $sectionText == '' )
                                $sectionText = null;
 
@@ -612,7 +612,7 @@ class SpecialSearch extends SpecialPage {
                }
 
                // format text extract
-               $extract = "<div class='searchresult'>".$result->getTextSnippet($terms)."</div>";
+               $extract = "<div class='searchresult'>" . $result->getTextSnippet( $terms ) . "</div>";
 
                $lang = $this->getLanguage();
 
@@ -723,7 +723,7 @@ class SpecialSearch extends SpecialPage {
                $terms = $wgContLang->convertForSearchResult( $matches->termMatches() );
 
                $out = "<div id='mw-search-interwiki'><div id='mw-search-interwiki-caption'>".
-                       $this->msg( 'search-interwiki-caption' )->text()  . "</div>\n";
+                       $this->msg( 'search-interwiki-caption' )->text() . "</div>\n";
                $out .= "<ul class='mw-search-iwresults'>\n";
 
                // work out custom project captions
@@ -773,7 +773,7 @@ class SpecialSearch extends SpecialPage {
 
                $t = $result->getTitle();
 
-               $titleSnippet = $result->getTitleSnippet($terms);
+               $titleSnippet = $result->getTitleSnippet( $terms );
 
                if( $titleSnippet == '' )
                        $titleSnippet = null;
@@ -785,9 +785,9 @@ class SpecialSearch extends SpecialPage {
 
                // format redirect if any
                $redirectTitle = $result->getRedirectTitle();
-               $redirectText = $result->getRedirectSnippet($terms);
+               $redirectText = $result->getRedirectSnippet( $terms );
                $redirect = '';
-               if( !is_null($redirectTitle) ) {
+               if( !is_null( $redirectTitle ) ) {
                        if( $redirectText == '' )
                                $redirectText = null;
 
@@ -799,8 +799,8 @@ class SpecialSearch extends SpecialPage {
 
                $out = "";
                // display project name
-               if(is_null($lastInterwiki) || $lastInterwiki != $t->getInterwiki()) {
-                       if( array_key_exists($t->getInterwiki(),$customCaptions) ) {
+               if( is_null( $lastInterwiki ) || $lastInterwiki != $t->getInterwiki() ) {
+                       if( array_key_exists( $t->getInterwiki(), $customCaptions ) ) {
                                // captions from 'search-interwiki-custom'
                                $caption = $customCaptions[$t->getInterwiki()];
                        } else {
@@ -810,7 +810,7 @@ class SpecialSearch extends SpecialPage {
                                $caption = $this->msg( 'search-interwiki-default', $parsed['host'] )->text();
                        }
                        // "more results" link (special page stuff could be localized, but we might not know target lang)
-                       $searchTitle = Title::newFromText($t->getInterwiki().":Special:Search");
+                       $searchTitle = Title::newFromText( $t->getInterwiki() . ":Special:Search" );
                        $searchLink = Linker::linkKnown(
                                $searchTitle,
                                $this->msg( 'search-interwiki-more' )->text(),
@@ -918,7 +918,7 @@ class SpecialSearch extends SpecialPage {
                                'fieldset',
                                array( 'id' => 'mw-searchoptions', 'style' => 'margin:0em;' )
                        ) .
-                       Xml::element( 'legend', null, $this->msg('powersearch-legend' )->text() ) .
+                       Xml::element( 'legend', null, $this->msg( 'powersearch-legend' )->text() ) .
                        Xml::tags( 'h4', null, $this->msg( 'powersearch-ns' )->parse() ) .
                        Html::element( 'div', array( 'id' => 'mw-search-togglebox' ) ) .
                        Xml::element( 'div', array( 'class' => 'divider' ), '', false ) .
@@ -985,7 +985,7 @@ class SpecialSearch extends SpecialPage {
         * @return string
         */
        protected function formHeader( $term, $resultsShown, $totalNum ) {
-               $out = Xml::openElement('div', array( 'class' =>  'mw-search-formheader' ) );
+               $out = Xml::openElement( 'div', array( 'class' => 'mw-search-formheader' ) );
 
                $bareterm = $term;
                if( $this->startsWithImage( $term ) ) {
@@ -1022,7 +1022,7 @@ class SpecialSearch extends SpecialPage {
                        );
                }
                $out .= Xml::closeElement( 'ul' );
-               $out .= Xml::closeElement('div') ;
+               $out .= Xml::closeElement( 'div' ) ;
 
                // Results-info
                if ( $resultsShown > 0 ) {
@@ -1047,7 +1047,7 @@ class SpecialSearch extends SpecialPage {
                }
 
                $out .= Xml::element( 'div', array( 'style' => 'clear:both' ), '', false );
-               $out .= Xml::closeElement('div');
+               $out .= Xml::closeElement( 'div' );
 
                return $out;
        }
index 1ea6e46..245ce20 100644 (file)
@@ -474,7 +474,7 @@ class PageArchive {
                                __METHOD__ );
 
                        if( $previousTimestamp === false ) {
-                               wfDebug( __METHOD__.": existing page refers to a page_latest that does not exist\n" );
+                               wfDebug( __METHOD__ . ": existing page refers to a page_latest that does not exist\n" );
 
                                $status = Status::newGood( 0 );
                                $status->warning( 'undeleterevision-missing' );
@@ -512,7 +512,8 @@ class PageArchive {
                        'ar_deleted',
                        'ar_page_id',
                        'ar_len',
-                       'ar_sha1');
+                       'ar_sha1'
+               );
 
                if ( $wgContentHandlerUseDB ) {
                        $fields[] = 'ar_content_format';
@@ -1075,10 +1076,10 @@ class SpecialUndelete extends SpecialPage {
                                        $targetQuery
                                ) .
                        '</strong></div>' .
-                       '<div id="mw-diff-'.$prefix.'title2">' .
+                       '<div id="mw-diff-' . $prefix . 'title2">' .
                                Linker::revUserTools( $rev ) . '<br />' .
                        '</div>' .
-                       '<div id="mw-diff-'.$prefix.'title3">' .
+                       '<div id="mw-diff-' . $prefix . 'title3">' .
                                Linker::revComment( $rev ) . $rdel . '<br />' .
                        '</div>';
        }
@@ -1230,7 +1231,7 @@ class SpecialUndelete extends SpecialPage {
                                                        Xml::label( $this->msg( 'undeletecomment' )->text(), 'wpComment' ) .
                                                "</td>
                                                <td class='mw-input'>" .
-                                                       Xml::input( 'wpComment', 50, $this->mComment, array( 'id' =>  'wpComment' ) ) .
+                                                       Xml::input( 'wpComment', 50, $this->mComment, array( 'id' => 'wpComment' ) ) .
                                                "</td>
                                        </tr>
                                        <tr>
@@ -1348,7 +1349,7 @@ class SpecialUndelete extends SpecialPage {
                // Revision delete links
                $revdlink = Linker::getRevDeleteLink( $user, $rev, $this->mTargetObj );
 
-               $revisionRow = $this->msg( 'undelete-revisionrow' )->rawParams( $checkBox, $revdlink, $last, $pageLink , $userLink, $revTextSize, $comment )->escaped();
+               $revisionRow = $this->msg( 'undelete-revisionrow' )->rawParams( $checkBox, $revdlink, $last, $pageLink, $userLink, $revTextSize, $comment )->escaped();
                return "<li>$revisionRow</li>";
        }
 
index 3f9851e..31f9669 100644 (file)
@@ -349,7 +349,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                                'name' => 'clear',
                        )
                ), $this->getContext(), 'clearStashedUploads' );
-               $form->setSubmitCallback( array( __CLASS__ , 'tryClearStashedUploads' ) );
+               $form->setSubmitCallback( array( __CLASS__, 'tryClearStashedUploads' ) );
                $form->setTitle( $this->getTitle() );
                $form->setSubmitTextMsg( 'uploadstash-clear' );
 
index 121cc22..53570a9 100644 (file)
@@ -379,7 +379,7 @@ class UserrightsPage extends SpecialPage {
                global $wgScript;
                $this->getOutput()->addHTML(
                        Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1' ) ) .
-                       Html::hidden( 'title',  $this->getTitle()->getPrefixedText() ) .
+                       Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
                        Xml::fieldset( $this->msg( 'userrights-lookup-user' )->text() ) .
                        Xml::inputLabel( $this->msg( 'userrights-user-editname' )->text(), 'user', 'username', 30, str_replace( '_', ' ', $this->mTarget ) ) . ' ' .
                        Xml::submitButton( $this->msg( 'editusergroup' )->text() ) .
@@ -572,7 +572,7 @@ class UserrightsPage extends SpecialPage {
                                continue;
                        $ret .= Xml::element( 'th', null, $this->msg( 'userrights-' . $name . '-col', count( $column ) )->text() );
                }
-               $ret.= "</tr>\n<tr>\n";
+               $ret .= "</tr>\n<tr>\n";
                foreach( $columns as $column ) {
                        if( $column === array() )
                                continue;
index a34f83e..e91df0b 100644 (file)
@@ -593,7 +593,7 @@ class SpecialVersion extends SpecialPage {
         * @return String: HTML fragment
         */
        private function IPInfo() {
-               $ip =  str_replace( '--', ' - ', htmlspecialchars( $this->getRequest()->getIP() ) );
+               $ip = str_replace( '--', ' - ', htmlspecialchars( $this->getRequest()->getIP() ) );
                return "<!-- visited from $ip -->\n" .
                        "<span style='display:none'>visited from $ip</span>";
        }
@@ -829,16 +829,16 @@ class SpecialVersion extends SpecialPage {
 
        function showEasterEgg() {
                $rx = $rp = $xe = '';
-               $alpha = array("", "kbQW", "\$\n()");
+               $alpha = array( "", "kbQW", "\$\n()" );
                $beta = implode( "', '", $alpha);
-               $juliet = 'echo $delta + strrev($foxtrot) - $alfa + $wgVersion . base64_decode($bravo) * $charlie';
+               $juliet = 'echo $delta + strrev( $foxtrot ) - $alfa + $wgVersion . base64_decode( $bravo ) * $charlie';
                for ( $i = 1; $i <= 4; $i++ ) {
                        $rx .= '([^j]*)J';
                        $rp .= "+(\\$i)";
                }
 
                $rx = "/$rx/Sei";
-               $O = substr("$alpha')", 1);
+               $O = substr( "$alpha')", 1 );
                for ( $i = 1; $i <= strlen( $rx ) / 3; $i++ ) {
                        $rx[$i-1] = strtolower( $rx[$i-1] );
                }
index 85876e9..0b835a2 100644 (file)
@@ -69,7 +69,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                $opts->validateIntBounds( 'limit', 0, 5000 );
 
                // Give precedence to subpage syntax
-               if ( isset($par) ) {
+               if ( isset( $par ) ) {
                        $opts->setValue( 'target', $par );
                }
 
@@ -137,7 +137,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                );
 
                $namespace = $this->opts->getValue( 'namespace' );
-               if ( is_int($namespace) ) {
+               if ( is_int( $namespace ) ) {
                        $plConds['page_namespace'] = $namespace;
                        $tlConds['page_namespace'] = $namespace;
                        $ilConds['page_namespace'] = $namespace;
@@ -195,7 +195,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                                if( $hidelinks || $hidetrans || $hideredirs || $hideimages )
                                        $out->addHTML( $this->getFilterPanel() );
 
-                               $errMsg = is_int($namespace) ? 'nolinkshere-ns' : 'nolinkshere';
+                               $errMsg = is_int( $namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
                                $out->addWikiMsg( $errMsg, $this->target->getPrefixedText() );
                        }
                        return;
@@ -360,7 +360,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                $next = $this->msg( 'whatlinkshere-next' )->numParams( $currentLimit )->escaped();
 
                $changed = $this->opts->getChangedValues();
-               unset($changed['target']); // Already in the request title
+               unset( $changed['target'] ); // Already in the request title
 
                if ( 0 != $prevId ) {
                        $overrides = array( 'from' => $this->opts->getValue( 'back' ) );
@@ -446,7 +446,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                $hide = $this->msg( 'hide' )->escaped();
 
                $changed = $this->opts->getChangedValues();
-               unset($changed['target']); // Already in the request title
+               unset( $changed['target'] ); // Already in the request title
 
                $links = array();
                $types = array( 'hidetrans', 'hidelinks', 'hideredirs' );
@@ -459,7 +459,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                        $chosen = $this->opts->getValue( $type );
                        $msg = $chosen ? $show : $hide;
                        $overrides = array( $type => !$chosen );
-                       $links[] =  $this->msg( "whatlinkshere-{$type}" )->rawParams(
+                       $links[] = $this->msg( "whatlinkshere-{$type}" )->rawParams(
                                $this->makeSelfLink( $msg, array_merge( $changed, $overrides ) ) )->escaped();
                }
                return Xml::fieldset( $this->msg( 'whatlinkshere-filters' )->text(), $this->getLanguage()->pipeList( $links ) );