fix some spacing
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 26 Jan 2013 18:15:35 +0000 (19:15 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 26 Jan 2013 18:15:35 +0000 (19:15 +0100)
Change-Id: I78a97ad87e0bfe724fc851daf6ffeeed81887800

25 files changed:
includes/search/SearchEngine.php
includes/search/SearchPostgres.php
includes/specials/SpecialAllmessages.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialBlockList.php
includes/specials/SpecialComparePages.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialImport.php
includes/specials/SpecialListfiles.php
includes/specials/SpecialListgrouprights.php
includes/specials/SpecialNewimages.php
includes/specials/SpecialPasswordReset.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialProtectedpages.php
includes/specials/SpecialProtectedtitles.php
includes/specials/SpecialRandompage.php
includes/specials/SpecialRandomredirect.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialSearch.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialVersion.php
includes/specials/SpecialWatchlist.php
includes/templates/Userlogin.php
includes/upload/UploadFromChunks.php

index 0199edb..e10b642 100644 (file)
@@ -183,7 +183,7 @@ class SearchEngine {
 
                        # Exact match? No need to look further.
                        $title = Title::newFromText( $term );
-                       if ( is_null( $title ) ){
+                       if ( is_null( $title ) ) {
                                return null;
                        }
 
@@ -1243,7 +1243,7 @@ class SearchHighlighter {
                        $posEnd = $end;
                }
 
-               if ( $end > $start )  {
+               if ( $end > $start ) {
                        return substr( $text, $start, $end - $start );
                } else {
                        return '';
@@ -1419,8 +1419,7 @@ class SearchHighlighter {
 
                        $line = htmlspecialchars( $pre . $found . $post );
                        $pat2 = '/(' . $terms . ")/i";
-                       $line = preg_replace( $pat2,
-                         "<span class='searchmatch'>\\1</span>", $line );
+                       $line = preg_replace( $pat2, "<span class='searchmatch'>\\1</span>", $line );
 
                        $extract .= "${line}\n";
                }
index 6864889..9c89c3d 100644 (file)
@@ -51,11 +51,11 @@ class SearchPostgres extends SearchEngine {
         * @return PostgresSearchResultSet
         */
        function searchTitle( $term ) {
-               $q = $this->searchQuery( $term , 'titlevector', 'page_title' );
-               $olderror = error_reporting(E_ERROR);
+               $q = $this->searchQuery( $term, 'titlevector', 'page_title' );
+               $olderror = error_reporting( E_ERROR );
                $resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) );
-               error_reporting($olderror);
-               if (!$resultSet) {
+               error_reporting( $olderror );
+               if ( !$resultSet ) {
                        // Needed for "Query requires full scan, GIN doesn't support it"
                        return new SearchResultTooMany();
                }
@@ -186,10 +186,10 @@ class SearchPostgres extends SearchEngine {
                        $query .= ' AND page_is_redirect = 0';
 
                ## Namespaces - defaults to 0
-               if( !is_null($this->namespaces) ){ // null -> search all
-                       if ( count($this->namespaces) < 1)
+               if( !is_null( $this->namespaces ) ) { // null -> search all
+                       if ( count( $this->namespaces ) < 1 ) {
                                $query .= ' AND page_namespace = 0';
-                       else {
+                       else {
                                $namespaces = $this->db->makeList( $this->namespaces );
                                $query .= " AND page_namespace IN ($namespaces)";
                        }
@@ -211,7 +211,7 @@ class SearchPostgres extends SearchEngine {
                $SQL = "UPDATE pagecontent SET textvector = NULL WHERE old_id IN ".
                                "(SELECT rev_text_id FROM revision WHERE rev_page = " . intval( $pageid ) .
                                " ORDER BY rev_text_id DESC OFFSET 1)";
-               $this->db->query($SQL);
+               $this->db->query( $SQL );
                return true;
        }
 
index fe9d41e..5f8a0e4 100644 (file)
@@ -118,7 +118,7 @@ class AllmessagesTablePager extends TablePager {
                $request = $this->getRequest();
 
                $this->filter = $request->getVal( 'filter', 'all' );
-               if( $this->filter === 'all' ){
+               if( $this->filter === 'all' ) {
                        $this->custom = null; // So won't match in either case
                } else {
                        $this->custom = ($this->filter == 'unmodified');
@@ -126,7 +126,7 @@ class AllmessagesTablePager extends TablePager {
 
                $prefix = $this->getLanguage()->ucfirst( $request->getVal( 'prefix', '' ) );
                $prefix = $prefix != '' ? Title::makeTitleSafe( NS_MEDIAWIKI, $request->getVal( 'prefix', null ) ) : null;
-               if( $prefix !== null ){
+               if( $prefix !== null ) {
                        $this->displayPrefix = $prefix->getDBkey();
                        $this->prefix = '/^' . preg_quote( $this->displayPrefix ) . '/i';
                } else {
@@ -150,7 +150,7 @@ class AllmessagesTablePager extends TablePager {
                $msg = wfMessage( 'allmessages-language' );
                $langSelect = Xml::languageSelector( $this->langcode, false, null, $attrs, $msg );
 
-               $out  = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-allmessages-form' ) ) .
+               $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-allmessages-form' ) ) .
                        Xml::fieldset( $this->msg( 'allmessages-filter-legend' )->text() ) .
                        Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
                        Xml::openElement( 'table', array( 'class' => 'mw-allmessages-table' ) ) . "\n" .
@@ -216,7 +216,7 @@ class AllmessagesTablePager extends TablePager {
        function getAllMessages( $descending ) {
                wfProfileIn( __METHOD__ );
                $messageNames = Language::getLocalisationCache()->getSubitemList( 'en', 'messages' );
-               if( $descending ){
+               if( $descending ) {
                        rsort( $messageNames );
                } else {
                        asort( $messageNames );
@@ -331,15 +331,15 @@ class AllmessagesTablePager extends TablePager {
                        </tr></thead><tbody>\n";
        }
 
-       function formatValue( $field, $value ){
-               switch( $field ){
+       function formatValue( $field, $value ) {
+               switch( $field ) {
 
                        case 'am_title' :
 
                                $title = Title::makeTitle( NS_MEDIAWIKI, $value . $this->suffix );
                                $talk  = Title::makeTitle( NS_MEDIAWIKI_TALK, $value . $this->suffix );
 
-                               if( $this->mCurrentRow->am_customised ){
+                               if( $this->mCurrentRow->am_customised ) {
                                        $title = Linker::linkKnown( $title, $this->getLanguage()->lcfirst( $value ) );
                                } else {
                                        $title = Linker::link(
@@ -351,7 +351,7 @@ class AllmessagesTablePager extends TablePager {
                                        );
                                }
                                if ( $this->mCurrentRow->am_talk_exists ) {
-                                       $talk = Linker::linkKnown( $talk , $this->talk );
+                                       $talk = Linker::linkKnown( $talk, $this->talk );
                                } else {
                                        $talk = Linker::link(
                                                $talk,
@@ -370,12 +370,12 @@ class AllmessagesTablePager extends TablePager {
                return '';
        }
 
-       function formatRow( $row ){
+       function formatRow( $row ) {
                // Do all the normal stuff
                $s = parent::formatRow( $row );
 
                // But if there's a customised message, add that too.
-               if( $row->am_customised ){
+               if( $row->am_customised ) {
                        $s .= Xml::openElement( 'tr', $this->getRowAttrs( $row, true ) );
                        $formatted = strval( $this->formatValue( 'am_actual', $row->am_actual ) );
                        if ( $formatted == '' ) {
@@ -387,19 +387,19 @@ class AllmessagesTablePager extends TablePager {
                return $s;
        }
 
-       function getRowAttrs( $row, $isSecond = false ){
+       function getRowAttrs( $row, $isSecond = false ) {
                $arr = array();
-               if( $row->am_customised ){
+               if( $row->am_customised ) {
                        $arr['class'] = 'allmessages-customised';
                }
-               if( !$isSecond ){
+               if( !$isSecond ) {
                        $arr['id'] = Sanitizer::escapeId( 'msg_' . $this->getLanguage()->lcfirst( $row->am_title ) );
                }
                return $arr;
        }
 
-       function getCellAttrs( $field, $value ){
-               if( $this->mCurrentRow->am_customised && $field == 'am_title' ){
+       function getCellAttrs( $field, $value ) {
+               if( $this->mCurrentRow->am_customised && $field == 'am_title' ) {
                        return array( 'rowspan' => '2', 'class' => $field );
                } elseif( $field == 'am_title' ) {
                        return array( 'class' => $field );
@@ -420,16 +420,15 @@ class AllmessagesTablePager extends TablePager {
                return SpecialPage::getTitleFor( 'Allmessages', false );
        }
 
-       function isFieldSortable( $x ){
+       function isFieldSortable( $x ) {
                return false;
        }
 
-       function getDefaultSort(){
+       function getDefaultSort() {
                return '';
        }
 
-       function getQueryInfo(){
+       function getQueryInfo() {
                return '';
        }
 }
-
index 0f8b255..abfb719 100644 (file)
@@ -61,7 +61,7 @@ class SpecialAllpages extends IncludableSpecialPage {
         *
         * @param $name string: name of the special page, as seen in links and URLs (default: 'Allpages')
         */
-       function __construct( $name = 'Allpages' ){
+       function __construct( $name = 'Allpages' ) {
                parent::__construct( $name );
        }
 
@@ -127,7 +127,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                        Xml::label( $this->msg( 'allpagesfrom' )->text(), 'nsfrom' ) .
                        "       </td>
        <td class='mw-input'>" .
-                       Xml::input( 'from', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) .
+                       Xml::input( 'from', 30, str_replace( '_', ' ', $from ), array( 'id' => 'nsfrom' ) ) .
                        "       </td>
 </tr>
 <tr>
@@ -135,7 +135,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                        Xml::label( $this->msg( 'allpagesto' )->text(), 'nsto' ) .
                        "       </td>
                        <td class='mw-input'>" .
-                       Xml::input( 'to', 30, str_replace('_',' ',$to), array( 'id' => 'nsto' ) ) .
+                       Xml::input( 'to', 30, str_replace( '_', ' ', $to ), array( 'id' => 'nsto' ) ) .
                        "               </td>
 </tr>
 <tr>
@@ -198,8 +198,8 @@ class SpecialAllpages extends IncludableSpecialPage {
                $lines = $wgMemc->get( $key );
 
                $count = $dbr->estimateRowCount( 'page', '*', $where, __METHOD__ );
-               $maxPerSubpage = intval($count/$this->maxLineCount);
-               $maxPerSubpage = max($maxPerSubpage,$this->maxPerPage);
+               $maxPerSubpage = intval( $count / $this->maxLineCount );
+               $maxPerSubpage = max( $maxPerSubpage, $this->maxPerPage );
 
                if( !is_array( $lines ) ) {
                        $options = array( 'LIMIT' => 1 );
index d740082..d1afe58 100644 (file)
@@ -113,14 +113,14 @@ class SpecialBlockList extends SpecialPage {
 
                $conds = array();
                # Is the user allowed to see hidden blocks?
-               if ( !$this->getUser()->isAllowed( 'hideuser' ) ){
+               if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
                        $conds['ipb_deleted'] = 0;
                }
 
-               if ( $this->target !== '' ){
+               if ( $this->target !== '' ) {
                        list( $target, $type ) = Block::parseTarget( $this->target );
 
-                       switch( $type ){
+                       switch( $type ) {
                                case Block::TYPE_ID:
                                case Block::TYPE_AUTO:
                                        $conds['ipb_id'] = $target;
@@ -269,11 +269,11 @@ class BlockListPager extends TablePager {
                                break;
 
                        case 'ipb_target':
-                               if( $row->ipb_auto ){
+                               if( $row->ipb_auto ) {
                                        $formatted = $this->msg( 'autoblockid', $row->ipb_id )->parse();
                                } else {
                                        list( $target, $type ) = Block::parseTarget( $row->ipb_address );
-                                       switch( $type ){
+                                       switch( $type ) {
                                                case Block::TYPE_USER:
                                                case Block::TYPE_IP:
                                                        $formatted = Linker::userLink( $target->getId(), $target );
@@ -292,8 +292,8 @@ class BlockListPager extends TablePager {
 
                        case 'ipb_expiry':
                                $formatted = $this->getLanguage()->formatExpiry( $value, /* User preference timezone */ true );
-                               if( $this->getUser()->isAllowed( 'block' ) ){
-                                       if( $row->ipb_auto ){
+                               if( $this->getUser()->isAllowed( 'block' ) ) {
+                                       if( $row->ipb_auto ) {
                                                $links[] = Linker::linkKnown(
                                                        SpecialPage::getTitleFor( 'Unblock' ),
                                                        $msg['unblocklink'],
@@ -391,14 +391,14 @@ class BlockListPager extends TablePager {
                );
 
                # Is the user allowed to see hidden blocks?
-               if ( !$this->getUser()->isAllowed( 'hideuser' ) ){
+               if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
                        $info['conds']['ipb_deleted'] = 0;
                }
 
                return $info;
        }
 
-       public function getTableClass(){
+       public function getTableClass() {
                return 'TablePager mw-blocklist';
        }
 
@@ -418,7 +418,7 @@ class BlockListPager extends TablePager {
         * Do a LinkBatch query to minimise database load when generating all these links
         * @param $result
         */
-       function preprocessResults( $result ){
+       function preprocessResults( $result ) {
                wfProfileIn( __METHOD__ );
                # Do a link batch query
                $lb = new LinkBatch;
@@ -437,7 +437,7 @@ class BlockListPager extends TablePager {
                }
 
                $ua = UserArray::newFromIDs( $userids );
-               foreach( $ua as $user ){
+               foreach( $ua as $user ) {
                        $name = str_replace( ' ', '_', $user->getName() );
                        $lb->add( NS_USER, $name );
                        $lb->add( NS_USER_TALK, $name );
index 2b7036c..8be1cf0 100644 (file)
@@ -106,7 +106,7 @@ class SpecialComparePages extends SpecialPage {
                $form->trySubmit();
        }
 
-       public static function showDiff( $data, HTMLForm $form ){
+       public static function showDiff( $data, HTMLForm $form ) {
                $rev1 = self::revOrTitle( $data['Revision1'], $data['Page1'] );
                $rev2 = self::revOrTitle( $data['Revision2'], $data['Page2'] );
 
@@ -128,11 +128,11 @@ class SpecialComparePages extends SpecialPage {
        }
 
        public static function revOrTitle( $revision, $title ) {
-               if( $revision ){
+               if( $revision ) {
                        return $revision;
                } elseif( $title ) {
                        $title = Title::newFromText( $title );
-                       if( $title instanceof Title ){
+                       if( $title instanceof Title ) {
                                return $title->getLatestRevID();
                        }
                }
index ae7657c..6d5205a 100644 (file)
@@ -49,7 +49,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
 
        private $badItems = array();
 
-       public function __construct(){
+       public function __construct() {
                parent::__construct( 'EditWatchlist' );
        }
 
@@ -85,9 +85,9 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
 
                # B/C: $mode used to be waaay down the parameter list, and the first parameter
                # was $wgUser
-               if( $mode instanceof User ){
+               if( $mode instanceof User ) {
                        $args = func_get_args();
-                       if( count( $args >= 4 ) ){
+                       if( count( $args >= 4 ) ) {
                                $mode = $args[3];
                        }
                }
@@ -101,7 +101,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        case self::EDIT_RAW:
                                $out->setPageTitle( $this->msg( 'watchlistedit-raw-title' ) );
                                $form = $this->getRawForm();
-                               if( $form->show() ){
+                               if( $form->show() ) {
                                        $out->addHTML( $this->successMessage );
                                        $out->addReturnTo( SpecialPage::getTitleFor( 'Watchlist' ) );
                                }
@@ -111,7 +111,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        default:
                                $out->setPageTitle( $this->msg( 'watchlistedit-normal-title' ) );
                                $form = $this->getNormalForm();
-                               if( $form->show() ){
+                               if( $form->show() ) {
                                        $out->addHTML( $this->successMessage );
                                        $out->addReturnTo( SpecialPage::getTitleFor( 'Watchlist' ) );
                                } elseif ( $this->toc !== false ) {
@@ -153,7 +153,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                return array_unique( $list );
        }
 
-       public function submitRaw( $data ){
+       public function submitRaw( $data ) {
                $wanted = $this->extractTitles( $data['Titles'] );
                $current = $this->getWatchlist();
 
@@ -164,7 +164,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        $this->unwatchTitles( $toUnwatch );
                        $this->getUser()->invalidateCache();
 
-                       if( count( $toWatch ) > 0 || count( $toUnwatch ) > 0 ){
+                       if( count( $toWatch ) > 0 || count( $toUnwatch ) > 0 ) {
                                $this->successMessage = $this->msg( 'watchlistedit-raw-done' )->parse();
                        } else {
                                return false;
@@ -185,7 +185,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        $this->clearWatchlist();
                        $this->getUser()->invalidateCache();
 
-                       if( count( $current ) > 0 ){
+                       if( count( $current ) > 0 ) {
                                $this->successMessage = $this->msg( 'watchlistedit-raw-done' )->parse();
                        } else {
                                return false;
@@ -470,13 +470,13 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         *
         * @return HTMLForm
         */
-       protected function getNormalForm(){
+       protected function getNormalForm() {
                global $wgContLang;
 
                $fields = array();
                $count = 0;
 
-               foreach( $this->getWatchlistInfo() as $namespace => $pages ){
+               foreach( $this->getWatchlistInfo() as $namespace => $pages ) {
                        if ( $namespace >= 0 ) {
                                $fields['TitlesNs'.$namespace] = array(
                                        'class' => 'EditWatchlistCheckboxSeriesField',
@@ -485,7 +485,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                );
                        }
 
-                       foreach( array_keys( $pages ) as $dbkey ){
+                       foreach( array_keys( $pages ) as $dbkey ) {
                                $title = Title::makeTitleSafe( $namespace, $dbkey );
                                if ( $this->checkTitle( $title, $namespace, $dbkey ) ) {
                                        $text = $this->buildRemoveLine( $title );
@@ -564,7 +564,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         *
         * @return HTMLForm
         */
-       protected function getRawForm(){
+       protected function getRawForm() {
                $titles = implode( $this->getWatchlist(), "\n" );
                $fields = array(
                        'Titles' => array(
@@ -648,7 +648,7 @@ class WatchlistEditor extends SpecialEditWatchlist {}
  * Extend HTMLForm purely so we can have a more sane way of getting the section headers
  */
 class EditWatchlistNormalHTMLForm extends HTMLForm {
-       public function getLegend( $namespace ){
+       public function getLegend( $namespace ) {
                $namespace = substr( $namespace, 2 );
                return $namespace == NS_MAIN
                        ? $this->msg( 'blanknamespace' )->escaped()
index 1ae201b..7247470 100644 (file)
@@ -114,7 +114,7 @@ class SpecialImport extends SpecialPage {
                                throw new PermissionsError( 'importupload' );
                        }
                } elseif ( $sourceName == "interwiki" ) {
-                       if( !$user->isAllowed( 'import' ) ){
+                       if( !$user->isAllowed( 'import' ) ) {
                                throw new PermissionsError( 'import' );
                        }
                        $this->interwiki = $request->getVal( 'interwiki' );
@@ -153,7 +153,7 @@ class SpecialImport extends SpecialPage {
 
                        $out->addWikiMsg( "importstart" );
 
-                       $reporter = new ImportReporter( $importer, $isUpload, $this->interwiki , $this->logcomment);
+                       $reporter = new ImportReporter( $importer, $isUpload, $this->interwiki, $this->logcomment );
                        $reporter->setContext( $this->getContext() );
                        $exception = false;
 
index d459ac6..ef68302 100644 (file)
 
 class SpecialListFiles extends IncludableSpecialPage {
 
-       public function __construct(){
+       public function __construct() {
                parent::__construct( 'Listfiles' );
        }
 
-       public function execute( $par ){
+       public function execute( $par ) {
                $this->setHeaders();
                $this->outputHeader();
 
index 1f95c22..c82522a 100644 (file)
@@ -147,7 +147,7 @@ class SpecialListGroupRights extends SpecialPage {
         * @param $removeSelf Array of group this group is allowed to remove from self or true
         * @return string List of all granted permissions, separated by comma separator
         */
-        private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) {
+       private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) {
                $r = array();
                foreach( $permissions as $permission => $granted ) {
                        //show as granted only if it isn't revoked to prevent duplicate display of permissions
@@ -170,7 +170,7 @@ class SpecialListGroupRights extends SpecialPage {
                }
                sort( $r );
                $lang = $this->getLanguage();
-               if( $add === true ){
+               if( $add === true ) {
                        $r[] = $this->msg( 'listgrouprights-addgroup-all' )->escaped();
                } elseif( is_array( $add ) && count( $add ) ) {
                        $add = array_values( array_unique( $add ) );
@@ -179,7 +179,7 @@ class SpecialListGroupRights extends SpecialPage {
                                count( $add )
                        )->parse();
                }
-               if( $remove === true ){
+               if( $remove === true ) {
                        $r[] = $this->msg( 'listgrouprights-removegroup-all' )->escaped();
                } elseif( is_array( $remove ) && count( $remove ) ) {
                        $remove = array_values( array_unique( $remove ) );
@@ -188,7 +188,7 @@ class SpecialListGroupRights extends SpecialPage {
                                count( $remove )
                        )->parse();
                }
-               if( $addSelf === true ){
+               if( $addSelf === true ) {
                        $r[] = $this->msg( 'listgrouprights-addgroup-self-all' )->escaped();
                } elseif( is_array( $addSelf ) && count( $addSelf ) ) {
                        $addSelf = array_values( array_unique( $addSelf ) );
@@ -197,7 +197,7 @@ class SpecialListGroupRights extends SpecialPage {
                                count( $addSelf )
                        )->parse();
                }
-               if( $removeSelf === true ){
+               if( $removeSelf === true ) {
                        $r[] = $this->msg( 'listgrouprights-removegroup-self-all' )->parse();
                } elseif( is_array( $removeSelf ) && count( $removeSelf ) ) {
                        $removeSelf = array_values( array_unique( $removeSelf ) );
index 350aac6..caf48be 100644 (file)
  */
 class SpecialNewFiles extends IncludableSpecialPage {
 
-       public function __construct(){
+       public function __construct() {
                parent::__construct( 'Newimages' );
        }
 
-       public function execute( $par ){
+       public function execute( $par ) {
                $this->setHeaders();
                $this->outputHeader();
 
@@ -57,7 +57,7 @@ class NewFilesPager extends ReverseChronologicalPager {
 
        function __construct( IContextSource $context, $par = null ) {
                $this->like = $context->getRequest()->getText( 'like' );
-               $this->showbots = $context->getRequest()->getBool( 'showbots' , 0 );
+               $this->showbots = $context->getRequest()->getBool( 'showbots', 0 );
                if ( is_numeric( $par ) ) {
                        $this->setLimit( $par );
                }
@@ -85,10 +85,10 @@ class NewFilesPager extends ReverseChronologicalPager {
                        }
                }
 
-               if( !$wgMiserMode && $this->like !== null ){
+               if( !$wgMiserMode && $this->like !== null ) {
                        $dbr = wfGetDB( DB_SLAVE );
                        $likeObj = Title::newFromURL( $this->like );
-                       if( $likeObj instanceof Title ){
+                       if( $likeObj instanceof Title ) {
                                $like = $dbr->buildLike( $dbr->anyString(), strtolower( $likeObj->getDBkey() ), $dbr->anyString() );
                                $conds[] = "LOWER(img_name) $like";
                        }
@@ -104,18 +104,18 @@ class NewFilesPager extends ReverseChronologicalPager {
                return $query;
        }
 
-       function getIndexField(){
+       function getIndexField() {
                return 'img_timestamp';
        }
 
-       function getStartBody(){
+       function getStartBody() {
                if ( !$this->gallery ) {
                        $this->gallery = new ImageGallery();
                }
                return '';
        }
 
-       function getEndBody(){
+       function getEndBody() {
                return $this->gallery->toHTML();
        }
 
@@ -161,7 +161,7 @@ class NewFilesPager extends ReverseChronologicalPager {
                        ),
                );
 
-               if( $wgMiserMode ){
+               if( $wgMiserMode ) {
                        unset( $fields['like'] );
                }
 
index d7cf693..f42a7a1 100644 (file)
@@ -86,7 +86,7 @@ class SpecialPasswordReset extends FormSpecialPage {
                        );
                }
 
-               if( $this->getUser()->isAllowed( 'passwordreset' ) ){
+               if( $this->getUser()->isAllowed( 'passwordreset' ) ) {
                        $a['Capture'] = array(
                                'type' => 'check',
                                'label-message' => 'passwordreset-capture',
@@ -136,7 +136,7 @@ class SpecialPasswordReset extends FormSpecialPage {
                        }
                }
 
-               if( isset( $data['Capture'] ) && !$this->getUser()->isAllowed( 'passwordreset' ) ){
+               if( isset( $data['Capture'] ) && !$this->getUser()->isAllowed( 'passwordreset' ) ) {
                        // The user knows they don't have the passwordreset permission, but they tried to spoof the form.  That's naughty
                        throw new PermissionsError( 'passwordreset' );
                }
@@ -162,7 +162,7 @@ class SpecialPasswordReset extends FormSpecialPage {
                        );
                        if ( $res ) {
                                $users = array();
-                               foreach( $res as $row ){
+                               foreach( $res as $row ) {
                                        $users[] = User::newFromRow( $row );
                                }
                        } else {
@@ -180,8 +180,8 @@ class SpecialPasswordReset extends FormSpecialPage {
                        return array( $error );
                }
 
-               if( count( $users ) == 0 ){
-                       if( $method == 'email' ){
+               if( count( $users ) == 0 ) {
+                       if( $method == 'email' ) {
                                // Don't reveal whether or not an email address is in use
                                return true;
                        } else {
@@ -264,7 +264,7 @@ class SpecialPasswordReset extends FormSpecialPage {
 
                if ( $this->result->isGood() ) {
                        return true;
-               } elseif( isset( $data['Capture'] ) && $data['Capture'] ){
+               } elseif( isset( $data['Capture'] ) && $data['Capture'] ) {
                        // The email didn't send, but maybe they knew that and that's why they captured it
                        return true;
                } else {
@@ -275,10 +275,10 @@ class SpecialPasswordReset extends FormSpecialPage {
        }
 
        public function onSuccess() {
-               if( $this->getUser()->isAllowed( 'passwordreset' ) && $this->email != null ){
+               if( $this->getUser()->isAllowed( 'passwordreset' ) && $this->email != null ) {
                        // @todo: Logging
 
-                       if( $this->result->isGood() ){
+                       if( $this->result->isGood() ) {
                                $this->getOutput()->addWikiMsg( 'passwordreset-emailsent-capture' );
                        } else {
                                $this->getOutput()->addWikiMsg( 'passwordreset-emailerror-capture', $this->result->getMessage() );
index 7740b32..f3895e8 100644 (file)
@@ -29,7 +29,7 @@
 class SpecialPrefixindex extends SpecialAllpages {
        // Inherit $maxPerPage
 
-       function __construct(){
+       function __construct() {
                parent::__construct( 'Prefixindex' );
        }
 
@@ -101,7 +101,7 @@ class SpecialPrefixindex extends SpecialAllpages {
                                Xml::label( $this->msg( 'allpagesprefix' )->text(), 'nsfrom' ) .
                                "</td>
                                <td class='mw-input'>" .
-                                       Xml::input( 'prefix', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) .
+                                       Xml::input( 'prefix', 30, str_replace( '_', ' ', $from ), array( 'id' => 'nsfrom' ) ) .
                                "</td>
                        </tr>
                        <tr>
@@ -248,7 +248,7 @@ class SpecialPrefixindex extends SpecialAllpages {
                                }
                                $nextLink = Linker::linkKnown(
                                                $self,
-                                               $this->msg( 'nextpage', str_replace( '_',' ', $s->page_title ) )->escaped(),
+                                               $this->msg( 'nextpage', str_replace( '_', ' ', $s->page_title ) )->escaped(),
                                                array(),
                                                $query
                                        );
index db3f012..aceac3f 100644 (file)
@@ -78,7 +78,7 @@ class SpecialProtectedpages extends SpecialPage {
 
                static $infinity = null;
 
-               if( is_null( $infinity ) ){
+               if( is_null( $infinity ) ) {
                        $infinity = wfGetDB( DB_SLAVE )->getInfinity();
                }
 
index cf1e2b4..da0a63c 100644 (file)
@@ -76,7 +76,7 @@ class SpecialProtectedtitles extends SpecialPage {
 
                static $infinity = null;
 
-               if( is_null( $infinity ) ){
+               if( is_null( $infinity ) ) {
                        $infinity = wfGetDB( DB_SLAVE )->getInfinity();
                }
 
@@ -248,4 +248,3 @@ class ProtectedTitlesPager extends AlphabeticPager {
                return 'pt_timestamp';
        }
 }
-
index 307088e..13a7043 100644 (file)
@@ -32,7 +32,7 @@ class RandomPage extends SpecialPage {
        protected $isRedir = false; // should the result be a redirect?
        protected $extra = array(); // Extra SQL statements
 
-       public function __construct( $name = 'Randompage' ){
+       public function __construct( $name = 'Randompage' ) {
                $this->namespaces = MWNamespace::getContentNamespaces();
                parent::__construct( $name );
        }
@@ -49,7 +49,7 @@ class RandomPage extends SpecialPage {
        }
 
        // select redirects instead of normal pages?
-       public function isRedirect(){
+       public function isRedirect() {
                return $this->isRedir;
        }
 
index 88c81b3..51783a2 100644 (file)
@@ -28,7 +28,7 @@
  * @ingroup SpecialPage
  */
 class SpecialRandomredirect extends RandomPage {
-       function __construct(){
+       function __construct() {
                parent::__construct( 'Randomredirect' );
                $this->isRedir = true;
        }
index a8166db..6502c72 100644 (file)
@@ -155,7 +155,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                // Fetch results, prepare a batch link existence check query
                $conds = $this->buildMainQueryConds( $opts );
                $rows = $this->doMainQuery( $conds, $opts );
-               if( $rows === false ){
+               if( $rows === false ) {
                        if( !$this->including() ) {
                                $this->doHeader( $opts );
                        }
@@ -186,7 +186,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
         *
         * @return Array
         */
-       public function getFeedObject( $feedFormat ){
+       public function getFeedObject( $feedFormat ) {
                $changesFeed = new ChangesFeed( $feedFormat, 'rcfeed' );
                $formatter = $changesFeed->getFeedObject(
                        $this->msg( 'recentchanges' )->inContentLanguage()->text(),
@@ -281,9 +281,9 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                # It makes no sense to hide both anons and logged-in users
                # Where this occurs, force anons to be shown
                $forcebot = false;
-               if( $opts['hideanons'] && $opts['hideliu'] ){
+               if( $opts['hideanons'] && $opts['hideliu'] ) {
                        # Check if the user wants to show bots only
-                       if( $opts['hidebots'] ){
+                       if( $opts['hidebots'] ) {
                                $opts['hideanons'] = false;
                        } else {
                                $forcebot = true;
@@ -297,8 +297,8 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $cutoff = $dbr->timestamp( $cutoff_unixtime );
 
                $fromValid = preg_match('/^[0-9]{14}$/', $opts['from']);
-               if( $fromValid && $opts['from'] > wfTimestamp(TS_MW,$cutoff) ) {
-                       $cutoff = $dbr->timestamp($opts['from']);
+               if( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) {
+                       $cutoff = $dbr->timestamp( $opts['from'] );
                } else {
                        $opts->reset( 'from' );
                }
@@ -729,7 +729,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
         * @param $opts FormOptions
         */
        function filterByCategories( &$rows, FormOptions $opts ) {
-               $categories = array_map( 'trim', explode( '|' , $opts['categories'] ) );
+               $categories = array_map( 'trim', explode( '|', $opts['categories'] ) );
 
                if( !count( $categories ) ) {
                        return;
index 4d57bc7..3dae3a7 100644 (file)
@@ -29,7 +29,7 @@
 class SpecialRecentchangeslinked extends SpecialRecentChanges {
        var $rclTargetTitle;
 
-       function __construct(){
+       function __construct() {
                parent::__construct( 'Recentchangeslinked' );
        }
 
@@ -50,7 +50,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                return $opts;
        }
 
-       public function getFeedObject( $feedFormat ){
+       public function getFeedObject( $feedFormat ) {
                $feed = new ChangesFeed( $feedFormat, false );
                $feedObj = $feed->getFeedObject(
                        $this->msg( 'recentchangeslinked-title', $this->getTargetTitle()->getPrefixedText() )
@@ -71,7 +71,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                }
                $outputPage = $this->getOutput();
                $title = Title::newFromURL( $target );
-               if( !$title || $title->getInterwiki() != '' ){
+               if( !$title || $title->getInterwiki() != '' ) {
                        $outputPage->wrapWikiMsg( "<div class=\"errorbox\">\n$1\n</div><br style=\"clear: both\" />", 'allpagesbadtitle' );
                        return false;
                }
@@ -228,13 +228,13 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
         * @param $opts FormOptions
         * @return array
         */
-       function getExtraOptions( $opts ){
+       function getExtraOptions( $opts ) {
                $opts->consumeValues( array( 'showlinkedto', 'target', 'tagfilter' ) );
                $extraOpts = array();
                $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
                $extraOpts['target'] = array( $this->msg( 'recentchangeslinked-page' )->escaped(),
-                       Xml::input( 'target', 40, str_replace('_',' ',$opts['target']) ) .
-                       Xml::check( 'showlinkedto', $opts['showlinkedto'], array('id' => 'showlinkedto') ) . ' ' .
+                       Xml::input( 'target', 40, str_replace( '_', ' ', $opts['target'] ) ) .
+                       Xml::check( 'showlinkedto', $opts['showlinkedto'], array( 'id' => 'showlinkedto' ) ) . ' ' .
                        Xml::label( $this->msg( 'recentchangeslinked-to' )->text(), 'showlinkedto' ) );
                $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] );
                if ($tagFilter) {
index bc90d2b..397a24f 100644 (file)
@@ -729,10 +729,11 @@ class SpecialSearch extends SpecialPage {
                // work out custom project captions
                $customCaptions = array();
                $customLines = explode( "\n", $this->msg( 'search-interwiki-custom' )->text() ); // format per line <iwprefix>:<caption>
-               foreach($customLines as $line) {
-                       $parts = explode(":",$line,2);
-                       if(count($parts) == 2) // validate line
+               foreach( $customLines as $line ) {
+                       $parts = explode( ":", $line, 2 );
+                       if( count( $parts ) == 2 ) { // validate line
                                $customCaptions[$parts[0]] = $parts[1];
+                       }
                }
 
                $prev = null;
@@ -1025,7 +1026,7 @@ class SpecialSearch extends SpecialPage {
 
                // Results-info
                if ( $resultsShown > 0 ) {
-                       if ( $totalNum > 0 ){
+                       if ( $totalNum > 0 ) {
                                $top = $this->msg( 'showingresultsheader' )
                                        ->numParams( $this->offset + 1, $this->offset + $resultsShown, $totalNum )
                                        ->params( wfEscapeWikiText( $term ) )
index 853a805..076469c 100644 (file)
@@ -32,11 +32,11 @@ class SpecialUnblock extends SpecialPage {
        protected $type;
        protected $block;
 
-       public function __construct(){
+       public function __construct() {
                parent::__construct( 'Unblock', 'block' );
        }
 
-       public function execute( $par ){
+       public function execute( $par ) {
                $this->checkPermissions();
                $this->checkReadOnly();
 
@@ -56,8 +56,8 @@ class SpecialUnblock extends SpecialPage {
                $form->setSubmitTextMsg( 'ipusubmit' );
                $form->addPreText( $this->msg( 'unblockiptext' )->parseAsBlock() );
 
-               if( $form->show() ){
-                       switch( $this->type ){
+               if( $form->show() ) {
+                       switch( $this->type ) {
                                case Block::TYPE_USER:
                                case Block::TYPE_IP:
                                        $out->addWikiMsg( 'unblocked', wfEscapeWikiText( $this->target ) );
@@ -73,7 +73,7 @@ class SpecialUnblock extends SpecialPage {
                }
        }
 
-       protected function getFields(){
+       protected function getFields() {
                $fields = array(
                        'Target' => array(
                                'type' => 'text',
@@ -92,21 +92,21 @@ class SpecialUnblock extends SpecialPage {
                        )
                );
 
-               if( $this->block instanceof Block ){
+               if( $this->block instanceof Block ) {
                        list( $target, $type ) = $this->block->getTargetAndType();
 
                        # Autoblocks are logged as "autoblock #123 because the IP was recently used by
                        # User:Foo, and we've just got any block, auto or not, that applies to a target
                        # the user has specified.  Someone could be fishing to connect IPs to autoblocks,
                        # so don't show any distinction between unblocked IPs and autoblocked IPs
-                       if( $type == Block::TYPE_AUTO && $this->type == Block::TYPE_IP ){
+                       if( $type == Block::TYPE_AUTO && $this->type == Block::TYPE_IP ) {
                                $fields['Target']['default'] = $this->target;
                                unset( $fields['Name'] );
 
                        } else {
                                $fields['Target']['default'] = $target;
                                $fields['Target']['type'] = 'hidden';
-                               switch( $type ){
+                               switch( $type ) {
                                        case Block::TYPE_USER:
                                        case Block::TYPE_IP:
                                                $fields['Name']['default'] = Linker::link(
@@ -152,12 +152,12 @@ class SpecialUnblock extends SpecialPage {
         * @throws ErrorPageError
         * @return Array( Array(message key, parameters) ) on failure, True on success
         */
-       public static function processUnblock( array $data, IContextSource $context ){
+       public static function processUnblock( array $data, IContextSource $context ) {
                $performer = $context->getUser();
                $target = $data['Target'];
                $block = Block::newFromTarget( $data['Target'] );
 
-               if( !$block instanceof Block ){
+               if( !$block instanceof Block ) {
                        return array( array( 'ipb_cant_unblock', $target ) );
                }
 
@@ -173,8 +173,8 @@ class SpecialUnblock extends SpecialPage {
                # unblock the whole range.
                list( $target, $type ) = SpecialBlock::getTargetAndType( $target );
                if( $block->getType() == Block::TYPE_RANGE && $type == Block::TYPE_IP ) {
-                        $range = $block->getTarget();
-                        return array( array( 'ipb_blocked_as_range', $target, $range ) );
+                       $range = $block->getTarget();
+                       return array( array( 'ipb_blocked_as_range', $target, $range ) );
                }
 
                # If the name was hidden and the blocking user cannot hide
index 01a12c0..6ea3bf1 100644 (file)
@@ -40,7 +40,7 @@ class SpecialVersion extends SpecialPage {
                'https://svn.wikimedia.org/svnroot/mediawiki' => 'https://svn.wikimedia.org/viewvc/mediawiki',
        );
 
-       public function __construct(){
+       public function __construct() {
                parent::__construct( 'Version' );
        }
 
@@ -152,7 +152,7 @@ class SpecialVersion extends SpecialPage {
                wfRunHooks( 'SoftwareInfo', array( &$software ) );
 
                $out = Xml::element( 'h2', array( 'id' => 'mw-version-software' ), wfMessage( 'version-software' )->text() ) .
-                          Xml::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-software' ) ) .
+                               Xml::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-software' ) ) .
                                "<tr>
                                        <th>" . wfMessage( 'version-software-product' )->text() . "</th>
                                        <th>" . wfMessage( 'version-software-version' )->text() . "</th>
@@ -841,8 +841,8 @@ class SpecialVersion extends SpecialPage {
                }
                $ry = ".*?(.((.)(.))).{1,3}(.)(.{1,$i})(\\4.\\3)(.).*";
                $ry = "/$ry/Sei";
-               $O = substr("$beta')", 1);
-               preg_match_all('/(?<=\$)[[:alnum:]]*/',substr($juliet, 0, $i<<1), $charlie);
+               $O = substr( "$beta')", 1 );
+               preg_match_all( '/(?<=\$)[[:alnum:]]*/', substr( $juliet, 0, $i<<1 ), $charlie );
                foreach( $charlie[0] as $bravo ) {
                        $$bravo =& $xe;
                }
index afa9c78..1c7c98a 100644 (file)
@@ -26,7 +26,7 @@ class SpecialWatchlist extends SpecialPage {
        /**
         * Constructor
         */
-       public function __construct( $page = 'Watchlist' ){
+       public function __construct( $page = 'Watchlist' ) {
                parent::__construct( $page );
        }
 
@@ -76,7 +76,7 @@ class SpecialWatchlist extends SpecialPage {
                $mode = SpecialEditWatchlist::getMode( $request, $par );
                if( $mode !== false ) {
                        # TODO: localise?
-                       switch( $mode ){
+                       switch( $mode ) {
                                case SpecialEditWatchlist::EDIT_CLEAR:
                                        $mode = 'clear';
                                        break;
@@ -249,7 +249,7 @@ class SpecialWatchlist extends SpecialPage {
                }
 
                # Create output form
-               $form  = Xml::fieldset( $this->msg( 'watchlist-options' )->text(), false, array( 'id' => 'mw-watchlist-options' ) );
+               $form = Xml::fieldset( $this->msg( 'watchlist-options' )->text(), false, array( 'id' => 'mw-watchlist-options' ) );
 
                # Show watchlist header
                $form .= $this->msg( 'watchlist-details' )->numParams( $nitems )->parse();
index 182992a..7bc0241 100644 (file)
@@ -144,7 +144,7 @@ class UserloginTemplate extends QuickTemplate {
                        'tabindex' => '9'
                ) );
                if ( $this->data['useemail'] && $this->data['canreset'] ) {
-                       if( $this->data['resetlink'] === true ){
+                       if( $this->data['resetlink'] === true ) {
                                echo '&#160;';
                                echo Linker::link(
                                        SpecialPage::getTitleFor( 'PasswordReset' ),
index 821f482..3d8737d 100644 (file)
@@ -112,7 +112,7 @@ class UploadFromChunks extends UploadFromFile {
                // Concatenate all the chunks to mVirtualTempPath
                $fileList = Array();
                // The first chunk is stored at the mVirtualTempPath path so we start on "chunk 1"
-               for( $i = 0; $i <= $this->getChunkIndex(); $i++ ){
+               for( $i = 0; $i <= $this->getChunkIndex(); $i++ ) {
                        $fileList[] = $this->getVirtualChunkLocation( $i );
                }
 
@@ -127,7 +127,7 @@ class UploadFromChunks extends UploadFromFile {
                $tStart = microtime( true );
                $status = $this->repo->concatenate( $fileList, $tmpPath, FileRepo::DELETE_SOURCE );
                $tAmount = microtime( true ) - $tStart;
-               if( !$status->isOk() ){
+               if( !$status->isOk() ) {
                        return $status;
                }
                wfDebugLog( 'fileconcatenate', "Combined $i chunks in $tAmount seconds.\n" );
@@ -190,7 +190,7 @@ class UploadFromChunks extends UploadFromFile {
                                // Update local chunk index for the current chunk
                                $this->mChunkIndex++;
                                $status = $this->outputChunk( $chunkPath );
-                               if( $status->isGood() ){
+                               if( $status->isGood() ) {
                                        // Update local offset:
                                        $this->mOffset = $preAppendOffset + $chunkSize;
                                        // Update chunk table status db
@@ -257,7 +257,7 @@ class UploadFromChunks extends UploadFromFile {
         * @return Integer index of the current chunk
         */
        private function getChunkIndex() {
-               if( $this->mChunkIndex !== null ){
+               if( $this->mChunkIndex !== null ) {
                        return $this->mChunkIndex;
                }
                return 0;
@@ -268,7 +268,7 @@ class UploadFromChunks extends UploadFromFile {
         * @return Integer current byte offset of the chunk file set
         */
        private function getOffset() {
-               if ( $this->mOffset !== null ){
+               if ( $this->mOffset !== null ) {
                        return $this->mOffset;
                }
                return 0;
@@ -307,7 +307,7 @@ class UploadFromChunks extends UploadFromFile {
        }
 
        private function getChunkFileKey( $index = null ) {
-               if( $index === null ){
+               if( $index === null ) {
                        $index = $this->getChunkIndex();
                }
                return $this->mFileKey . '.' . $index ;