Fixed spacing in specials folder
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 19 Apr 2013 20:55:47 +0000 (22:55 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 20 Apr 2013 08:20:51 +0000 (10:20 +0200)
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I7873c656b16f6e905bb5abb2c2db6f6e84c11430

36 files changed:
includes/specials/SpecialBooksources.php
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialListfiles.php
includes/specials/SpecialListgrouprights.php
includes/specials/SpecialListredirects.php
includes/specials/SpecialListusers.php
includes/specials/SpecialLog.php
includes/specials/SpecialLonelypages.php
includes/specials/SpecialMergeHistory.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialNewimages.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialPasswordReset.php
includes/specials/SpecialPopularpages.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialProtectedpages.php
includes/specials/SpecialProtectedtitles.php
includes/specials/SpecialRandompage.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialSearch.php
includes/specials/SpecialSpecialpages.php
includes/specials/SpecialStatistics.php
includes/specials/SpecialTags.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialUncategorizedpages.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUploadStash.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialUserrights.php
includes/specials/SpecialVersion.php
includes/specials/SpecialWatchlist.php
includes/specials/SpecialWhatlinkshere.php
includes/specials/SpecialWithoutinterwiki.php

index 3170c29..0d76883 100644 (file)
@@ -166,8 +166,9 @@ class SpecialBookSources extends SpecialPage {
                $this->getOutput()->addWikiMsg( 'booksources-text' );
                $this->getOutput()->addHTML( '<ul>' );
                $items = $wgContLang->getBookstoreList();
-               foreach ( $items as $label => $url )
+               foreach ( $items as $label => $url ) {
                        $this->getOutput()->addHTML( $this->makeListItem( $label, $url ) );
+               }
                $this->getOutput()->addHTML( '</ul>' );
 
                return true;
index ab42549..63881a7 100644 (file)
@@ -85,7 +85,7 @@ class SpecialJavaScriptTest extends SpecialPage {
         */
        private function getFrameworkListHtml() {
                $list = '<ul>';
-               foreach( self::$frameworks as $framework => $initFn ) {
+               foreach ( self::$frameworks as $framework => $initFn ) {
                        $list .= Html::rawElement(
                                'li',
                                array(),
@@ -109,7 +109,7 @@ class SpecialJavaScriptTest extends SpecialPage {
         */
        private function wrapSummaryHtml( $html, $state ) {
                $validStates = array( 'noframework', 'unknownframework', 'frameworkfound' );
-               if( !in_array( $state, $validStates ) ) {
+               if ( !in_array( $state, $validStates ) ) {
                        throw new MWException( __METHOD__
                                . ' given an invalid state. Must be one of "'
                                . join( '", "', $validStates ) . '".'
index ded881c..3abfd5f 100644 (file)
@@ -55,7 +55,7 @@ class LinkSearchPage extends QueryPage {
                $namespace = $request->getIntorNull( 'namespace', null );
 
                $protocols_list = array();
-               foreach( $wgUrlProtocols as $prot ) {
+               foreach ( $wgUrlProtocols as $prot ) {
                        if ( $prot !== '//' ) {
                                $protocols_list[] = $prot;
                        }
@@ -111,14 +111,15 @@ class LinkSearchPage extends QueryPage {
                        Html::closeElement( 'form' ) . "\n";
                $out->addHTML( $s );
 
-               if( $target != '' ) {
+               if ( $target != '' ) {
                        $this->setParams( array(
                                'query' => $target2,
                                'namespace' => $namespace,
                                'protocol' => $protocol ) );
                        parent::execute( $par );
-                       if( $this->mMungedQuery === false )
+                       if ( $this->mMungedQuery === false ) {
                                $out->addWikiMsg( 'linksearch-error' );
+                       }
                }
        }
 
@@ -155,7 +156,7 @@ class LinkSearchPage extends QueryPage {
                global $wgMiserMode;
                $params = array();
                $params['target'] = $this->mProt . $this->mQuery;
-               if( isset( $this->mNs ) && !$wgMiserMode ) {
+               if ( isset( $this->mNs ) && !$wgMiserMode ) {
                        $params['namespace'] = $this->mNs;
                }
                return $params;
@@ -168,9 +169,10 @@ class LinkSearchPage extends QueryPage {
                // index-based-only lookup would be done
                list( $this->mMungedQuery, $clause ) = self::mungeQuery(
                                $this->mQuery, $this->mProt );
-               if( $this->mMungedQuery === false )
+               if ( $this->mMungedQuery === false ) {
                        // Invalid query; return no results
                        return array( 'tables' => 'page', 'fields' => 'page_id', 'conds' => '0=1' );
+               }
 
                $stripped = LinkFilter::keepOneWildcard( $this->mMungedQuery );
                $like = $dbr->buildLike( $stripped );
@@ -208,7 +210,7 @@ class LinkSearchPage extends QueryPage {
         */
        function doQuery( $offset = false, $limit = false ) {
                list( $this->mMungedQuery, ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt );
-               if( $this->mMungedQuery === false ) {
+               if ( $this->mMungedQuery === false ) {
                        $this->getOutput()->addWikiMsg( 'linksearch-error' );
                } else {
                        // For debugging
index c864ae2..9c2d039 100644 (file)
@@ -118,7 +118,7 @@ class ImageListPager extends TablePager {
                                'img_user_text' => $this->msg( 'listfiles_user' )->text(),
                                'img_description' => $this->msg( 'listfiles_description' )->text(),
                        );
-                       if( !$wgMiserMode ) {
+                       if ( !$wgMiserMode ) {
                                $this->mFieldNames['count'] = $this->msg( 'listfiles_count' )->text();
                        }
                }
@@ -145,7 +145,7 @@ class ImageListPager extends TablePager {
                $options = $join_conds = array();
 
                # Depends on $wgMiserMode
-               if( isset( $this->mFieldNames['count'] ) ) {
+               if ( isset( $this->mFieldNames['count'] ) ) {
                        $tables[] = 'oldimage';
 
                        # Need to rewrite this one
@@ -157,7 +157,7 @@ class ImageListPager extends TablePager {
                        unset( $field );
 
                        $dbr = wfGetDB( DB_SLAVE );
-                       if( $dbr->implicitGroupby() ) {
+                       if ( $dbr->implicitGroupby() ) {
                                $options = array( 'GROUP BY' => 'img_name' );
                        } else {
                                $columnlist = preg_grep( '/^img/', array_keys( $this->getFieldNames() ) );
@@ -166,10 +166,10 @@ class ImageListPager extends TablePager {
                        $join_conds = array( 'oldimage' => array( 'LEFT JOIN', 'oi_name = img_name' ) );
                }
                return array(
-                       'tables'     => $tables,
-                       'fields'     => $fields,
-                       'conds'      => $this->mQueryConds,
-                       'options'    => $options,
+                       'tables' => $tables,
+                       'fields' => $fields,
+                       'conds' => $this->mQueryConds,
+                       'options' => $options,
                        'join_conds' => $join_conds
                );
        }
@@ -198,11 +198,13 @@ class ImageListPager extends TablePager {
                                return htmlspecialchars( $this->getLanguage()->userTimeAndDate( $value, $this->getUser() ) );
                        case 'img_name':
                                static $imgfile = null;
-                               if ( $imgfile === null ) $imgfile = $this->msg( 'imgfile' )->text();
+                               if ( $imgfile === null ) {
+                                       $imgfile = $this->msg( 'imgfile' )->text();
+                               }
 
                                // Weird files can maybe exist? Bug 22227
                                $filePage = Title::makeTitleSafe( NS_FILE, $value );
-                               if( $filePage ) {
+                               if ( $filePage ) {
                                        $link = Linker::linkKnown( $filePage, htmlspecialchars( $filePage->getText() ) );
                                        $download = Xml::element( 'a',
                                                array( 'href' => wfLocalFile( $filePage )->getURL() ),
@@ -240,15 +242,15 @@ class ImageListPager extends TablePager {
                if ( !$wgMiserMode ) {
                        $inputForm['listfiles_search_for'] = Html::input( 'ilsearch', $this->mSearch, 'text',
                                array(
-                                       'size'          => '40',
+                                       'size' => '40',
                                        'maxlength' => '255',
-                                       'id'            => 'mw-ilsearch',
+                                       'id' => 'mw-ilsearch',
                        ) );
                }
                $inputForm['username'] = Html::input( 'user', $this->mUserName, 'text', array(
-                       'size'          => '40',
+                       'size' => '40',
                        'maxlength' => '255',
-                       'id'            => 'mw-listfiles-user',
+                       'id' => 'mw-listfiles-user',
                ) );
                return Html::openElement( 'form',
                                array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
index 7cccf88..3309682 100644 (file)
@@ -85,7 +85,7 @@ class SpecialListGroupRights extends SpecialPage {
                                $msg->text() :
                                MWNamespace::getCanonicalName( NS_PROJECT ) . ':' . $groupname;
 
-                       if( $group == '*' ) {
+                       if ( $group == '*' ) {
                                // Do not make a link for the generic * group
                                $grouppage = htmlspecialchars( $groupnameLocalized );
                        } else {
@@ -149,9 +149,9 @@ class SpecialListGroupRights extends SpecialPage {
         */
        private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) {
                $r = array();
-               foreach( $permissions as $permission => $granted ) {
+               foreach ( $permissions as $permission => $granted ) {
                        //show as granted only if it isn't revoked to prevent duplicate display of permissions
-                       if( $granted && ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) ) {
+                       if ( $granted && ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) ) {
                                $description = $this->msg( 'listgrouprights-right-display',
                                        User::getRightDescription( $permission ),
                                        '<span class="mw-listgrouprights-right-name">' . $permission . '</span>'
@@ -159,8 +159,8 @@ class SpecialListGroupRights extends SpecialPage {
                                $r[] = $description;
                        }
                }
-               foreach( $revoke as $permission => $revoked ) {
-                       if( $revoked ) {
+               foreach ( $revoke as $permission => $revoked ) {
+                       if ( $revoked ) {
                                $description = $this->msg( 'listgrouprights-right-revoked',
                                        User::getRightDescription( $permission ),
                                        '<span class="mw-listgrouprights-right-name">' . $permission . '</span>'
@@ -170,43 +170,43 @@ 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 ) ) {
+               } elseif ( is_array( $add ) && count( $add ) ) {
                        $add = array_values( array_unique( $add ) );
                        $r[] = $this->msg( 'listgrouprights-addgroup',
                                $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $add ) ),
                                count( $add )
                        )->parse();
                }
-               if( $remove === true ) {
+               if ( $remove === true ) {
                        $r[] = $this->msg( 'listgrouprights-removegroup-all' )->escaped();
-               } elseif( is_array( $remove ) && count( $remove ) ) {
+               } elseif ( is_array( $remove ) && count( $remove ) ) {
                        $remove = array_values( array_unique( $remove ) );
                        $r[] = $this->msg( 'listgrouprights-removegroup',
                                $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $remove ) ),
                                count( $remove )
                        )->parse();
                }
-               if( $addSelf === true ) {
+               if ( $addSelf === true ) {
                        $r[] = $this->msg( 'listgrouprights-addgroup-self-all' )->escaped();
-               } elseif( is_array( $addSelf ) && count( $addSelf ) ) {
+               } elseif ( is_array( $addSelf ) && count( $addSelf ) ) {
                        $addSelf = array_values( array_unique( $addSelf ) );
                        $r[] = $this->msg( 'listgrouprights-addgroup-self',
                                $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $addSelf ) ),
                                count( $addSelf )
                        )->parse();
                }
-               if( $removeSelf === true ) {
+               if ( $removeSelf === true ) {
                        $r[] = $this->msg( 'listgrouprights-removegroup-self-all' )->parse();
-               } elseif( is_array( $removeSelf ) && count( $removeSelf ) ) {
+               } elseif ( is_array( $removeSelf ) && count( $removeSelf ) ) {
                        $removeSelf = array_values( array_unique( $removeSelf ) );
                        $r[] = $this->msg( 'listgrouprights-removegroup-self',
                                $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $removeSelf ) ),
                                count( $removeSelf )
                        )->parse();
                }
-               if( empty( $r ) ) {
+               if ( empty( $r ) ) {
                        return '';
                } else {
                        return '<ul><li>' . implode( "</li>\n<li>", $r ) . '</li></ul>';
index 24888c0..4401499 100644 (file)
@@ -121,7 +121,7 @@ class ListredirectsPage extends QueryPage {
 
                # Find out where the redirect leads
                $target = $this->getRedirectTarget( $result );
-               if( $target ) {
+               if ( $target ) {
                        # Make a link to the destination page
                        $lang = $this->getLanguage();
                        $arr = $lang->getArrow() . $lang->getDirMark();
index d253a4d..d674b05 100644 (file)
@@ -69,7 +69,7 @@ class UsersPager extends AlphabeticPager {
                $this->requestedUser = '';
                if ( $un != '' ) {
                        $username = Title::makeTitleSafe( NS_USER, $un );
-                       if( ! is_null( $username ) ) {
+                       if ( ! is_null( $username ) ) {
                                $this->requestedUser = $username->getText();
                        }
                }
@@ -90,26 +90,26 @@ class UsersPager extends AlphabeticPager {
                $dbr = wfGetDB( DB_SLAVE );
                $conds = array();
                // Don't show hidden names
-               if( !$this->getUser()->isAllowed( 'hideuser' ) ) {
+               if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
                        $conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0';
                }
 
                $options = array();
 
-               if( $this->requestedGroup != '' ) {
+               if ( $this->requestedGroup != '' ) {
                        $conds['ug_group'] = $this->requestedGroup;
                } else {
                        //$options['USE INDEX'] = $this->creationSort ? 'PRIMARY' : 'user_name';
                }
-               if( $this->requestedUser != '' ) {
+               if ( $this->requestedUser != '' ) {
                        # Sorted either by account creation or name
-                       if( $this->creationSort ) {
+                       if ( $this->creationSort ) {
                                $conds[] = 'user_id >= ' . intval( User::idFromName( $this->requestedUser ) );
                        } else {
                                $conds[] = 'user_name >= ' . $dbr->addQuotes( $this->requestedUser );
                        }
                }
-               if( $this->editsOnly ) {
+               if ( $this->editsOnly ) {
                        $conds[] = 'user_editcount > 0';
                }
 
@@ -159,15 +159,16 @@ class UsersPager extends AlphabeticPager {
 
                $groups = '';
                $groups_list = self::getGroups( $row->user_id );
-               if( !$this->including && count( $groups_list ) > 0 ) {
+               if ( !$this->including && count( $groups_list ) > 0 ) {
                        $list = array();
-                       foreach( $groups_list as $group )
+                       foreach ( $groups_list as $group ) {
                                $list[] = self::buildGroupLink( $group, $userName );
+                       }
                        $groups = $lang->commaList( $list );
                }
 
                $item = $lang->specialList( $ulinks, $groups );
-               if( $row->ipb_deleted ) {
+               if ( $row->ipb_deleted ) {
                        $item = "<span class=\"deleted\">$item</span>";
                }
 
@@ -179,7 +180,7 @@ class UsersPager extends AlphabeticPager {
 
                $created = '';
                # Some rows may be NULL
-               if( !$this->including && $row->creation ) {
+               if ( !$this->including && $row->creation ) {
                        $user = $this->getUser();
                        $d = $lang->userDate( $row->creation, $user );
                        $t = $lang->userTime( $row->creation, $user );
@@ -233,8 +234,9 @@ class UsersPager extends AlphabeticPager {
                $out .= Xml::label( $this->msg( 'group' )->text(), 'group' ) . ' ' .
                        Xml::openElement( 'select', array( 'name' => 'group', 'id' => 'group' ) ) .
                        Xml::option( $this->msg( 'group-all' )->text(), '' );
-               foreach( $this->getAllGroups() as $group => $groupText )
+               foreach ( $this->getAllGroups() as $group => $groupText ) {
                        $out .= Xml::option( $groupText, $group, $group == $this->requestedGroup );
+               }
                $out .= Xml::closeElement( 'select' ) . '<br />';
                $out .= Xml::checkLabel( $this->msg( 'listusers-editsonly' )->text(), 'editsOnly', 'editsOnly', $this->editsOnly );
                $out .= '&#160;';
@@ -259,7 +261,7 @@ class UsersPager extends AlphabeticPager {
         */
        function getAllGroups() {
                $result = array();
-               foreach( User::getAllGroups() as $group ) {
+               foreach ( User::getAllGroups() as $group ) {
                        $result[$group] = User::getGroupName( $group );
                }
                asort( $result );
@@ -272,10 +274,10 @@ class UsersPager extends AlphabeticPager {
         */
        function getDefaultQuery() {
                $query = parent::getDefaultQuery();
-               if( $this->requestedGroup != '' ) {
+               if ( $this->requestedGroup != '' ) {
                        $query['group'] = $this->requestedGroup;
                }
-               if( $this->requestedUser != '' ) {
+               if ( $this->requestedUser != '' ) {
                        $query['username'] = $this->requestedUser;
                }
                wfRunHooks( 'SpecialListusersDefaultQuery', array( $this, &$query ) );
@@ -337,7 +339,7 @@ class SpecialListUsers extends IncludableSpecialPage {
                        $s = $up->getPageHeader();
                }
 
-               if( $usersbody ) {
+               if ( $usersbody ) {
                        $s .= $up->getNavigationBar();
                        $s .= Html::rawElement( 'ul', array(), $usersbody );
                        $s .= $up->getNavigationBar();
index 4fc0f6e..5b6ff18 100644 (file)
@@ -99,10 +99,10 @@ class SpecialLog extends SpecialPage {
                # Some log types are only for a 'User:' title but we might have been given
                # only the username instead of the full title 'User:username'. This part try
                # to lookup for a user by that name and eventually fix user input. See bug 1697.
-               if( in_array( $opts->getValue( 'type' ), $this->typeOnUser ) ) {
+               if ( in_array( $opts->getValue( 'type' ), $this->typeOnUser ) ) {
                        # ok we have a type of log which expect a user title.
                        $target = Title::newFromText( $opts->getValue( 'page' ) );
-                       if( $target && $target->getNamespace() === NS_MAIN ) {
+                       if ( $target && $target->getNamespace() === NS_MAIN ) {
                                # User forgot to add 'User:', we are adding it for him
                                $opts->setValue( 'page',
                                        Title::makeTitleSafe( NS_USER, $opts->getValue( 'page' ) )
index 33f291b..6bccdc7 100644 (file)
@@ -75,7 +75,7 @@ class LonelyPagesPage extends PageQueryPage {
        function getOrderFields() {
                // For some crazy reason ordering by a constant
                // causes a filesort in MySQL 5
-               if( count( MWNamespace::getContentNamespaces() ) > 1 ) {
+               if ( count( MWNamespace::getContentNamespaces() ) > 1 ) {
                        return array( 'page_namespace', 'page_title' );
                } else {
                        return array( 'page_title' );
index 1476e15..013c800 100644 (file)
@@ -52,14 +52,14 @@ class SpecialMergeHistory extends SpecialPage {
                $this->mTargetID = intval( $request->getVal( 'targetID' ) );
                $this->mDestID = intval( $request->getVal( 'destID' ) );
                $this->mTimestamp = $request->getVal( 'mergepoint' );
-               if( !preg_match( '/[0-9]{14}/', $this->mTimestamp ) ) {
+               if ( !preg_match( '/[0-9]{14}/', $this->mTimestamp ) ) {
                        $this->mTimestamp = '';
                }
                $this->mComment = $request->getText( 'wpComment' );
 
                $this->mMerge = $request->wasPosted() && $this->getUser()->matchEditToken( $request->getVal( 'wpEditToken' ) );
                // target page
-               if( $this->mSubmitted ) {
+               if ( $this->mSubmitted ) {
                        $this->mTargetObj = Title::newFromURL( $this->mTarget );
                        $this->mDestObj = Title::newFromURL( $this->mDest );
                } else {
@@ -75,7 +75,7 @@ class SpecialMergeHistory extends SpecialPage {
         */
        function preCacheMessages() {
                // Precache various messages
-               if( !isset( $this->message ) ) {
+               if ( !isset( $this->message ) ) {
                        $this->message['last'] = $this->msg( 'last' )->escaped();
                }
        }
@@ -89,7 +89,7 @@ class SpecialMergeHistory extends SpecialPage {
                $this->setHeaders();
                $this->outputHeader();
 
-               if( $this->mTargetID && $this->mDestID && $this->mAction == 'submit' && $this->mMerge ) {
+               if ( $this->mTargetID && $this->mDestID && $this->mAction == 'submit' && $this->mMerge ) {
                        $this->merge();
                        return;
                }
@@ -102,7 +102,7 @@ class SpecialMergeHistory extends SpecialPage {
                $errors = array();
                if ( !$this->mTargetObj instanceof Title ) {
                        $errors[] = $this->msg( 'mergehistory-invalid-source' )->parseAsBlock();
-               } elseif( !$this->mTargetObj->exists() ) {
+               } elseif ( !$this->mTargetObj->exists() ) {
                        $errors[] = $this->msg( 'mergehistory-no-source', array( 'parse' ),
                                wfEscapeWikiText( $this->mTargetObj->getPrefixedText() )
                        )->parseAsBlock();
@@ -110,7 +110,7 @@ class SpecialMergeHistory extends SpecialPage {
 
                if ( !$this->mDestObj instanceof Title ) {
                        $errors[] = $this->msg( 'mergehistory-invalid-destination' )->parseAsBlock();
-               } elseif( !$this->mDestObj->exists() ) {
+               } elseif ( !$this->mDestObj->exists() ) {
                        $errors[] = $this->msg( 'mergehistory-no-destination', array( 'parse' ),
                                wfEscapeWikiText( $this->mDestObj->getPrefixedText() )
                        )->parseAsBlock();
@@ -183,7 +183,7 @@ class SpecialMergeHistory extends SpecialPage {
                );
                $out->addHTML( $top );
 
-               if( $haveRevisions ) {
+               if ( $haveRevisions ) {
                        # Format the user-visible controls (comment field, submission button)
                        # in a nice little table
                        $table =
@@ -216,7 +216,7 @@ class SpecialMergeHistory extends SpecialPage {
                        $this->msg( 'mergehistory-list' )->escaped() . "</h2>\n"
                );
 
-               if( $haveRevisions ) {
+               if ( $haveRevisions ) {
                        $out->addHTML( $revisions->getNavigationBar() );
                        $out->addHTML( '<ul>' );
                        $out->addHTML( $revisions->getBody() );
@@ -261,14 +261,14 @@ class SpecialMergeHistory extends SpecialPage {
                        array(),
                        array( 'oldid' => $rev->getId() )
                );
-               if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
+               if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
                        $pageLink = '<span class="history-deleted">' . $pageLink . '</span>';
                }
 
                # Last link
-               if( !$rev->userCan( Revision::DELETED_TEXT, $user ) ) {
+               if ( !$rev->userCan( Revision::DELETED_TEXT, $user ) ) {
                        $last = $this->message['last'];
-               } elseif( isset( $this->prevId[$row->rev_id] ) ) {
+               } elseif ( isset( $this->prevId[$row->rev_id] ) ) {
                        $last = Linker::linkKnown(
                                $rev->getTitle(),
                                $this->message['last'],
@@ -283,7 +283,7 @@ class SpecialMergeHistory extends SpecialPage {
                $userLink = Linker::revUserTools( $rev );
 
                $size = $row->rev_len;
-               if( !is_null( $size ) ) {
+               if ( !is_null( $size ) ) {
                        $stxt = Linker::formatRevisionSize( $size );
                }
                $comment = Linker::revComment( $rev );
@@ -298,10 +298,10 @@ class SpecialMergeHistory extends SpecialPage {
                # keep it consistent...
                $targetTitle = Title::newFromID( $this->mTargetID );
                $destTitle = Title::newFromID( $this->mDestID );
-               if( is_null( $targetTitle ) || is_null( $destTitle ) ) {
+               if ( is_null( $targetTitle ) || is_null( $destTitle ) ) {
                        return false; // validate these
                }
-               if( $targetTitle->getArticleID() == $destTitle->getArticleID() ) {
+               if ( $targetTitle->getArticleID() == $destTitle->getArticleID() ) {
                        return false;
                }
                # Verify that this timestamp is valid
@@ -317,7 +317,7 @@ class SpecialMergeHistory extends SpecialPage {
                        __METHOD__
                );
                # Destination page must exist with revisions
-               if( !$maxtimestamp ) {
+               if ( !$maxtimestamp ) {
                        $this->getOutput()->addWikiMsg( 'mergehistory-fail' );
                        return false;
                }
@@ -329,12 +329,12 @@ class SpecialMergeHistory extends SpecialPage {
                        __METHOD__
                );
                # $this->mTimestamp must be older than $maxtimestamp
-               if( $this->mTimestamp >= $maxtimestamp ) {
+               if ( $this->mTimestamp >= $maxtimestamp ) {
                        $this->getOutput()->addWikiMsg( 'mergehistory-fail' );
                        return false;
                }
                # Update the revisions
-               if( $this->mTimestamp ) {
+               if ( $this->mTimestamp ) {
                        $timewhere = "rev_timestamp <= {$this->mTimestamp}";
                        $timestampLimit = wfTimestamp( TS_MW, $this->mTimestamp );
                } else {
@@ -358,8 +358,8 @@ class SpecialMergeHistory extends SpecialPage {
                        __METHOD__,
                        array( 'FOR UPDATE' )
                );
-               if( !$haveRevisions ) {
-                       if( $this->mComment ) {
+               if ( !$haveRevisions ) {
+                       if ( $this->mComment ) {
                                $comment = $this->msg(
                                        'mergehistory-comment',
                                        $targetTitle->getPrefixedText(),
@@ -380,8 +380,8 @@ class SpecialMergeHistory extends SpecialPage {
                        if ( $redirectContent ) {
                                $redirectPage = WikiPage::factory( $targetTitle );
                                $redirectRevision = new Revision( array(
-                                       'title'   => $targetTitle,
-                                       'page'    => $this->mTargetID,
+                                       'title' => $targetTitle,
+                                       'page' => $this->mTargetID,
                                        'comment' => $comment,
                                        'content' => $redirectContent ) );
                                $redirectRevision->insertOn( $dbw );
@@ -392,9 +392,9 @@ class SpecialMergeHistory extends SpecialPage {
                                $dbw->delete( 'pagelinks', array( 'pl_from' => $this->mDestID ), __METHOD__ );
                                $dbw->insert( 'pagelinks',
                                        array(
-                                               'pl_from'      => $this->mDestID,
+                                               'pl_from' => $this->mDestID,
                                                'pl_namespace' => $destTitle->getNamespace(),
-                                               'pl_title'     => $destTitle->getDBkey() ),
+                                               'pl_title' => $destTitle->getDBkey() ),
                                        __METHOD__
                                );
                        } else {
@@ -405,7 +405,7 @@ class SpecialMergeHistory extends SpecialPage {
                }
                $destTitle->invalidateCache(); // update histories
                # Check if this did anything
-               if( !$count ) {
+               if ( !$count ) {
                        $this->getOutput()->addWikiMsg( 'mergehistory-fail' );
                        return false;
                }
@@ -462,9 +462,9 @@ class MergeHistoryPager extends ReverseChronologicalPager {
                        $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->user_name ) );
 
                        $rev_id = isset( $rev_id ) ? $rev_id : $row->rev_id;
-                       if( $rev_id > $row->rev_id ) {
+                       if ( $rev_id > $row->rev_id ) {
                                $this->mForm->prevId[$rev_id] = $row->rev_id;
-                       } elseif( $rev_id < $row->rev_id ) {
+                       } elseif ( $rev_id < $row->rev_id ) {
                                $this->mForm->prevId[$row->rev_id] = $rev_id;
                        }
 
@@ -489,7 +489,7 @@ class MergeHistoryPager extends ReverseChronologicalPager {
                return array(
                        'tables' => array( 'revision', 'page', 'user' ),
                        'fields' => array_merge( Revision::selectFields(), Revision::selectUserFields() ),
-                       'conds'  => $conds,
+                       'conds' => $conds,
                        'join_conds' => array(
                                'page' => Revision::pageJoinCond(),
                                'user' => Revision::userJoinCond() )
index c35c44e..e7a86a6 100644 (file)
@@ -55,10 +55,10 @@ class MovePageForm extends UnlistedSpecialPage {
                $oldTitleText = $request->getVal( 'wpOldTitle', $target );
                $this->oldTitle = Title::newFromText( $oldTitleText );
 
-               if( is_null( $this->oldTitle ) ) {
+               if ( is_null( $this->oldTitle ) ) {
                        throw new ErrorPageError( 'notargettitle', 'notargettext' );
                }
-               if( !$this->oldTitle->exists() ) {
+               if ( !$this->oldTitle->exists() ) {
                        throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
                }
 
@@ -129,7 +129,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        # link, check for validity. We can then show some diagnostic
                        # information and save a click.
                        $newerr = $this->oldTitle->isValidMoveOperation( $newTitle );
-                       if( is_array( $newerr ) ) {
+                       if ( is_array( $newerr ) ) {
                                $err = $newerr;
                        }
                }
@@ -212,8 +212,8 @@ class MovePageForm extends UnlistedSpecialPage {
                                }
                        } else {
                                $errStr = array();
-                               foreach( $err as $errMsg ) {
-                                       if( $errMsg[0] == 'hookaborted' ) {
+                               foreach ( $err as $errMsg ) {
+                                       if ( $errMsg[0] == 'hookaborted' ) {
                                                $errStr[] = $errMsg[1];
                                        } else {
                                                $errMsgName = array_shift( $errMsg );
@@ -299,7 +299,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        </tr>"
                );
 
-               if( $considerTalk ) {
+               if ( $considerTalk ) {
                        $out->addHTML( "
                                <tr>
                                        <td></td>
@@ -334,7 +334,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        );
                }
 
-               if( $canMoveSubpage ) {
+               if ( $canMoveSubpage ) {
                        $out->addHTML( "
                                <tr>
                                        <td></td>
@@ -361,14 +361,14 @@ class MovePageForm extends UnlistedSpecialPage {
                $watchChecked = $user->isLoggedIn() && ( $this->watch || $user->getBoolOption( 'watchmoves' )
                        || $user->isWatched( $this->oldTitle ) );
                # Don't allow watching if user is not logged in
-               if( $user->isLoggedIn() ) {
+               if ( $user->isLoggedIn() ) {
                        $out->addHTML( "
                        <tr>
                                <td></td>
                                <td class='mw-input'>" .
                                        Xml::checkLabel( $this->msg( 'move-watch' )->text(), 'wpWatch', 'watch', $watchChecked ) .
                                "</td>
-                       </tr>");
+                       </tr>" );
                }
 
                $out->addHTML( "
@@ -502,7 +502,7 @@ class MovePageForm extends UnlistedSpecialPage {
                # Now we move extra pages we've been asked to move: subpages and talk
                # pages.  First, if the old page or the new page is a talk page, we
                # can't move any talk pages: cancel that.
-               if( $ot->isTalkPage() || $nt->isTalkPage() ) {
+               if ( $ot->isTalkPage() || $nt->isTalkPage() ) {
                        $this->moveTalk = false;
                }
 
@@ -524,7 +524,7 @@ class MovePageForm extends UnlistedSpecialPage {
 
                // @todo FIXME: Use Title::moveSubpages() here
                $dbr = wfGetDB( DB_MASTER );
-               if( $this->moveSubpages && (
+               if ( $this->moveSubpages && (
                        MWNamespace::hasSubpages( $nt->getNamespace() ) || (
                                $this->moveTalk &&
                                MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
@@ -535,13 +535,13 @@ class MovePageForm extends UnlistedSpecialPage {
                                        . ' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() )
                        );
                        $conds['page_namespace'] = array();
-                       if( MWNamespace::hasSubpages( $nt->getNamespace() ) ) {
+                       if ( MWNamespace::hasSubpages( $nt->getNamespace() ) ) {
                                $conds['page_namespace'][] = $ot->getNamespace();
                        }
-                       if( $this->moveTalk && MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() ) ) {
+                       if ( $this->moveTalk && MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() ) ) {
                                $conds['page_namespace'][] = $ot->getTalkPage()->getNamespace();
                        }
-               } elseif( $this->moveTalk ) {
+               } elseif ( $this->moveTalk ) {
                        $conds = array(
                                'page_namespace' => $ot->getTalkPage()->getNamespace(),
                                'page_title' => $ot->getDBkey()
@@ -552,7 +552,7 @@ class MovePageForm extends UnlistedSpecialPage {
                }
 
                $extraPages = array();
-               if( !is_null( $conds ) ) {
+               if ( !is_null( $conds ) ) {
                        $extraPages = TitleArray::newFromResult(
                                $dbr->select( 'page',
                                        array( 'page_id', 'page_namespace', 'page_title' ),
@@ -564,8 +564,8 @@ class MovePageForm extends UnlistedSpecialPage {
 
                $extraOutput = array();
                $count = 1;
-               foreach( $extraPages as $oldSubpage ) {
-                       if( $ot->equals( $oldSubpage ) ) {
+               foreach ( $extraPages as $oldSubpage ) {
+                       if ( $ot->equals( $oldSubpage ) ) {
                                # Already did this one.
                                continue;
                        }
@@ -575,7 +575,7 @@ class MovePageForm extends UnlistedSpecialPage {
                                StringUtils::escapeRegexReplacement( $nt->getDBkey() ), # bug 21234
                                $oldSubpage->getDBkey()
                        );
-                       if( $oldSubpage->isTalkPage() ) {
+                       if ( $oldSubpage->isTalkPage() ) {
                                $newNs = $nt->getTalkPage()->getNamespace();
                        } else {
                                $newNs = $nt->getSubjectPage()->getNamespace();
@@ -583,7 +583,7 @@ class MovePageForm extends UnlistedSpecialPage {
                        # Bug 14385: we need makeTitleSafe because the new page names may
                        # be longer than 255 characters.
                        $newSubpage = Title::makeTitleSafe( $newNs, $newPageName );
-                       if( !$newSubpage ) {
+                       if ( !$newSubpage ) {
                                $oldLink = Linker::linkKnown( $oldSubpage );
                                $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink
                                        )->params( Title::makeName( $newNs, $newPageName ) )->escaped();
@@ -596,7 +596,7 @@ class MovePageForm extends UnlistedSpecialPage {
                                $extraOutput[] = $this->msg( 'movepage-page-exists' )->rawParams( $link )->escaped();
                        } else {
                                $success = $oldSubpage->moveTo( $newSubpage, true, $this->reason, $createRedirect );
-                               if( $success === true ) {
+                               if ( $success === true ) {
                                        if ( $this->fixRedirects ) {
                                                DoubleRedirectJob::fixRedirects( 'move', $oldSubpage, $newSubpage );
                                        }
@@ -609,7 +609,7 @@ class MovePageForm extends UnlistedSpecialPage {
                                        $newLink = Linker::linkKnown( $newSubpage );
                                        $extraOutput[] = $this->msg( 'movepage-page-moved' )->rawParams( $oldLink, $newLink )->escaped();
                                        ++$count;
-                                       if( $count >= $wgMaximumMovedPages ) {
+                                       if ( $count >= $wgMaximumMovedPages ) {
                                                $extraOutput[] = $this->msg( 'movepage-max-pages' )->numParams( $wgMaximumMovedPages )->escaped();
                                                break;
                                        }
@@ -622,12 +622,12 @@ class MovePageForm extends UnlistedSpecialPage {
 
                }
 
-               if( $extraOutput !== array() ) {
+               if ( $extraOutput !== array() ) {
                        $out->addHTML( "<ul>\n<li>" . implode( "</li>\n<li>", $extraOutput ) . "</li>\n</ul>" );
                }
 
                # Deal with watches (we don't watch subpages)
-               if( $this->watch && $user->isLoggedIn() ) {
+               if ( $this->watch && $user->isLoggedIn() ) {
                        $user->addWatch( $ot );
                        $user->addWatch( $nt );
                } else {
@@ -638,7 +638,7 @@ class MovePageForm extends UnlistedSpecialPage {
                # Re-clear the file redirect cache, which may have been polluted by
                # parsing in messages above. See CR r56745.
                # @todo FIXME: Needs a more robust solution inside FileRepo.
-               if( $ot->getNamespace() == NS_FILE ) {
+               if ( $ot->getNamespace() == NS_FILE ) {
                        RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect( $ot );
                }
        }
@@ -651,8 +651,9 @@ class MovePageForm extends UnlistedSpecialPage {
        }
 
        function showSubpages( $title ) {
-               if( !MWNamespace::hasSubpages( $title->getNamespace() ) )
+               if ( !MWNamespace::hasSubpages( $title->getNamespace() ) ) {
                        return;
+               }
 
                $subpages = $title->getSubpages();
                $count = $subpages instanceof TitleArray ? $subpages->count() : 0;
@@ -669,7 +670,7 @@ class MovePageForm extends UnlistedSpecialPage {
                $out->addWikiMsg( 'movesubpagetext', $this->getLanguage()->formatNum( $count ) );
                $out->addHTML( "<ul>\n" );
 
-               foreach( $subpages as $subpage ) {
+               foreach ( $subpages as $subpage ) {
                        $link = Linker::link( $subpage );
                        $out->addHTML( "<li>$link</li>\n" );
                }
index 52cbc3a..b865f40 100644 (file)
@@ -73,9 +73,9 @@ class NewFilesPager extends ReverseChronologicalPager {
                $conds = $jconds = array();
                $tables = array( 'image' );
 
-               if( !$this->showbots ) {
+               if ( !$this->showbots ) {
                        $groupsWithBotPermission = User::getGroupsWithPermission( 'bot' );
-                       if( count( $groupsWithBotPermission ) ) {
+                       if ( count( $groupsWithBotPermission ) ) {
                                $tables[] = 'user_groups';
                                $conds[] = 'ug_group IS NULL';
                                $jconds['user_groups'] = array(
@@ -88,10 +88,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";
                        }
@@ -164,7 +164,7 @@ class NewFilesPager extends ReverseChronologicalPager {
                        ),
                );
 
-               if( $wgMiserMode ) {
+               if ( $wgMiserMode ) {
                        unset( $fields['like'] );
                }
 
index eefc1b7..46bf81a 100644 (file)
@@ -63,17 +63,19 @@ class SpecialNewpages extends IncludableSpecialPage {
 
                $this->customFilters = array();
                wfRunHooks( 'SpecialNewPagesFilters', array( $this, &$this->customFilters ) );
-               foreach( $this->customFilters as $key => $params ) {
+               foreach ( $this->customFilters as $key => $params ) {
                        $opts->add( $key, $params['default'] );
                }
 
                // Set values
                $opts->fetchValuesFromRequest( $this->getRequest() );
-               if ( $par ) $this->parseParams( $par );
+               if ( $par ) {
+                       $this->parseParams( $par );
+               }
 
                // Validate
                $opts->validateIntBounds( 'limit', 0, 5000 );
-               if( !$wgEnableNewpagesUserFilter ) {
+               if ( !$wgEnableNewpagesUserFilter ) {
                        $opts->setValue( 'username', '' );
                }
        }
@@ -113,7 +115,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                        }
                        if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) {
                                $ns = $this->getLanguage()->getNsIndex( $m[1] );
-                               if( $ns !== false ) {
+                               if ( $ns !== false ) {
                                        $this->opts->setValue( 'namespace', $ns );
                                }
                        }
@@ -135,12 +137,12 @@ class SpecialNewpages extends IncludableSpecialPage {
                $this->showNavigation = !$this->including(); // Maybe changed in setup
                $this->setup( $par );
 
-               if( !$this->including() ) {
+               if ( !$this->including() ) {
                        // Settings
                        $this->form();
 
                        $feedType = $this->opts->getValue( 'feed' );
-                       if( $feedType ) {
+                       if ( $feedType ) {
                                $this->feed( $feedType );
                                return;
                        }
@@ -154,7 +156,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                $pager->mLimit = $this->opts->getValue( 'limit' );
                $pager->mOffset = $this->opts->getValue( 'offset' );
 
-               if( $pager->getNumRows() ) {
+               if ( $pager->getNumRows() ) {
                        $navigation = '';
                        if ( $this->showNavigation ) {
                                $navigation = $pager->getNavigationBar();
@@ -244,8 +246,8 @@ class SpecialNewpages extends IncludableSpecialPage {
                                                        'selected' => $namespace,
                                                        'all' => 'all',
                                                ), array(
-                                                       'name'  => 'namespace',
-                                                       'id'    => 'namespace',
+                                                       'name' => 'namespace',
+                                                       'id' => 'namespace',
                                                        'class' => 'namespaceselector',
                                                )
                                        ) . '&#160;' .
@@ -331,7 +333,7 @@ class SpecialNewpages extends IncludableSpecialPage {
 
                $query = array( 'redirect' => 'no' );
 
-               if( $this->patrollable( $result ) ) {
+               if ( $this->patrollable( $result ) ) {
                        $query['rcid'] = $result->rc_id;
                }
 
@@ -369,7 +371,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                }
 
                # Tags, if any.
-               if( isset( $result->ts_tags ) ) {
+               if ( isset( $result->ts_tags ) ) {
                        list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow( $result->ts_tags, 'newpages' );
                        $classes = array_merge( $classes, $newClasses );
                } else {
@@ -411,7 +413,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                        return;
                }
 
-               if( !isset( $wgFeedClasses[$type] ) ) {
+               if ( !isset( $wgFeedClasses[$type] ) ) {
                        $this->getOutput()->addWikiMsg( 'feed-invalid' );
                        return;
                }
@@ -427,7 +429,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                $pager->mLimit = min( $limit, $wgFeedLimit );
 
                $feed->outHeader();
-               if( $pager->getNumRows() > 0 ) {
+               if ( $pager->getNumRows() > 0 ) {
                        foreach ( $pager->mResult as $row ) {
                                $feed->outItem( $this->feedItem( $row ) );
                        }
@@ -443,7 +445,7 @@ class SpecialNewpages extends IncludableSpecialPage {
 
        protected function feedItem( $row ) {
                $title = Title::makeTitle( intval( $row->rc_namespace ), $row->rc_title );
-               if( $title ) {
+               if ( $title ) {
                        $date = $row->rc_timestamp;
                        $comments = $title->getTalkPage()->getFullURL();
 
@@ -466,7 +468,7 @@ class SpecialNewpages extends IncludableSpecialPage {
 
        protected function feedItemDesc( $row ) {
                $revision = Revision::newFromId( $row->rev_id );
-               if( $revision ) {
+               if ( $revision ) {
                        //XXX: include content model/type in feed item?
                        return '<p>' . htmlspecialchars( $revision->getUserText() ) .
                                $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
@@ -511,7 +513,7 @@ class NewPagesPager extends ReverseChronologicalPager {
                $username = $this->opts->getValue( 'username' );
                $user = Title::makeTitleSafe( NS_USER, $username );
 
-               if( $namespace !== false ) {
+               if ( $namespace !== false ) {
                        if ( $this->opts->getValue( 'invert' ) ) {
                                $conds[] = 'rc_namespace != ' . $this->mDb->addQuotes( $namespace );
                        } else {
@@ -523,18 +525,18 @@ class NewPagesPager extends ReverseChronologicalPager {
                }
 
                # $wgEnableNewpagesUserFilter - temp WMF hack
-               if( $wgEnableNewpagesUserFilter && $user ) {
+               if ( $wgEnableNewpagesUserFilter && $user ) {
                        $conds['rc_user_text'] = $user->getText();
                        $rcIndexes = 'rc_user_text';
                # If anons cannot make new pages, don't "exclude logged in users"!
-               } elseif( User::groupHasPermission( '*', 'createpage' ) && $this->opts->getValue( 'hideliu' ) ) {
+               } elseif ( User::groupHasPermission( '*', 'createpage' ) && $this->opts->getValue( 'hideliu' ) ) {
                        $conds['rc_user'] = 0;
                }
                # If this user cannot see patrolled edits or they are off, don't do dumb queries!
-               if( $this->opts->getValue( 'hidepatrolled' ) && $this->getUser()->useNPPatrol() ) {
+               if ( $this->opts->getValue( 'hidepatrolled' ) && $this->getUser()->useNPPatrol() ) {
                        $conds['rc_patrolled'] = 0;
                }
-               if( $this->opts->getValue( 'hidebots' ) ) {
+               if ( $this->opts->getValue( 'hidebots' ) ) {
                        $conds['rc_bot'] = 0;
                }
 
@@ -546,7 +548,7 @@ class NewPagesPager extends ReverseChronologicalPager {
                $tables = array( 'recentchanges', 'page' );
                $fields = array(
                        'rc_namespace', 'rc_title', 'rc_cur_id', 'rc_user', 'rc_user_text',
-                       'rc_comment', 'rc_timestamp', 'rc_patrolled','rc_id', 'rc_deleted',
+                       'rc_comment', 'rc_timestamp', 'rc_patrolled', 'rc_id', 'rc_deleted',
                        'length' => 'page_len', 'rev_id' => 'page_latest', 'rc_this_oldid',
                        'page_namespace', 'page_title'
                );
@@ -556,10 +558,10 @@ class NewPagesPager extends ReverseChronologicalPager {
                        array( &$this, $this->opts, &$conds, &$tables, &$fields, &$join_conds ) );
 
                $info = array(
-                       'tables'         => $tables,
-                       'fields'         => $fields,
-                       'conds'          => $conds,
-                       'options'        => array( 'USE INDEX' => array( 'recentchanges' => $rcIndexes ) ),
+                       'tables' => $tables,
+                       'fields' => $fields,
+                       'conds' => $conds,
+                       'options' => array( 'USE INDEX' => array( 'recentchanges' => $rcIndexes ) ),
                        'join_conds' => $join_conds
                );
 
index a166b56..df9ed57 100644 (file)
@@ -70,7 +70,7 @@ class SpecialPasswordReset extends FormSpecialPage {
                                'type' => 'text',
                                'label-message' => 'passwordreset-username',
                        );
-                       if( $this->getUser()->isLoggedIn() ) {
+                       if ( $this->getUser()->isLoggedIn() ) {
                                $a['Username']['default'] = $this->getUser()->getName();
                        }
                }
@@ -91,7 +91,7 @@ class SpecialPasswordReset extends FormSpecialPage {
                        );
                }
 
-               if( $this->getUser()->isAllowed( 'passwordreset' ) ) {
+               if ( $this->getUser()->isAllowed( 'passwordreset' ) ) {
                        $a['Capture'] = array(
                                'type' => 'check',
                                'label-message' => 'passwordreset-capture',
@@ -141,7 +141,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' );
                }
@@ -167,7 +167,7 @@ class SpecialPasswordReset extends FormSpecialPage {
                        );
                        if ( $res ) {
                                $users = array();
-                               foreach( $res as $row ) {
+                               foreach ( $res as $row ) {
                                        $users[] = User::newFromRow( $row );
                                }
                        } else {
@@ -185,8 +185,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 {
@@ -262,7 +262,7 @@ class SpecialPasswordReset extends FormSpecialPage {
 
                $this->result = $firstUser->sendMail( $title->escaped(), $this->email->text() );
 
-               if( isset( $data['Capture'] ) && $data['Capture'] ) {
+               if ( isset( $data['Capture'] ) && $data['Capture'] ) {
                        // Save the user, will be used if an error occurs when sending the email
                        $this->firstUser = $firstUser;
                } else {
@@ -272,7 +272,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 {
@@ -283,10 +283,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',
index 61ba83b..81797f2 100644 (file)
@@ -60,7 +60,7 @@ class PopularPagesPage extends QueryPage {
                global $wgContLang;
 
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
-               if( !$title ) {
+               if ( !$title ) {
                        return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
                                Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
                }
index 6affa73..35b5e3c 100644 (file)
@@ -62,11 +62,11 @@ class SpecialPrefixindex extends SpecialAllpages {
                );
 
                $showme = '';
-               if( isset( $par ) ) {
+               if ( isset( $par ) ) {
                        $showme = $par;
-               } elseif( $prefix != '' ) {
+               } elseif ( $prefix != '' ) {
                        $showme = $prefix;
-               } elseif( $from != '' && $ns === null ) {
+               } elseif ( $from != '' && $ns === null ) {
                        // For back-compat with Special:Allpages
                        // Don't do this if namespace is passed, so paging works when doing NS views.
                        $showme = $from;
@@ -112,8 +112,8 @@ class SpecialPrefixindex extends SpecialAllpages {
                                Html::namespaceSelector( array(
                                                'selected' => $namespace,
                                        ), array(
-                                               'name'  => 'namespace',
-                                               'id'    => 'namespace',
+                                               'name' => 'namespace',
+                                               'id' => 'namespace',
                                                'class' => 'namespaceselector',
                                ) ) .
                                Xml::checkLabel(
@@ -178,8 +178,8 @@ class SpecialPrefixindex extends SpecialAllpages {
                                $conds,
                                __METHOD__,
                                array(
-                                       'ORDER BY'  => 'page_title',
-                                       'LIMIT'     => $this->maxPerPage + 1,
+                                       'ORDER BY' => 'page_title',
+                                       'LIMIT' => $this->maxPerPage + 1,
                                        'USE INDEX' => 'name_title',
                                )
                        );
@@ -187,12 +187,12 @@ class SpecialPrefixindex extends SpecialAllpages {
                        ### @todo FIXME: Side link to previous
 
                        $n = 0;
-                       if( $res->numRows() > 0 ) {
+                       if ( $res->numRows() > 0 ) {
                                $out = Xml::openElement( 'table', array( 'id' => 'mw-prefixindex-list-table' ) );
 
-                               while( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
+                               while ( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
                                        $t = Title::makeTitle( $s->page_namespace, $s->page_title );
-                                       if( $t ) {
+                                       if ( $t ) {
                                                $link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
                                                        Linker::linkKnown(
                                                                $t,
@@ -203,16 +203,16 @@ class SpecialPrefixindex extends SpecialAllpages {
                                        } else {
                                                $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
                                        }
-                                       if( $n % 3 == 0 ) {
+                                       if ( $n % 3 == 0 ) {
                                                $out .= '<tr>';
                                        }
                                        $out .= "<td>$link</td>";
                                        $n++;
-                                       if( $n % 3 == 0 ) {
+                                       if ( $n % 3 == 0 ) {
                                                $out .= '</tr>';
                                        }
                                }
-                               if( ($n % 3) != 0 ) {
+                               if ( ($n % 3) != 0 ) {
                                        $out .= '</tr>';
                                }
                                $out .= Xml::closeElement( 'table' );
@@ -234,14 +234,14 @@ class SpecialPrefixindex extends SpecialAllpages {
                                        '</td>
                                        <td id="mw-prefixindex-nav-form" class="mw-prefixindex-nav">';
 
-                       if( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
+                       if ( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
                                $query = array(
                                        'from' => $s->page_title,
                                        'prefix' => $prefix,
                                        'hideredirects' => $hideredirects,
                                );
 
-                               if( $namespace || $prefix == '' ) {
+                               if ( $namespace || $prefix == '' ) {
                                        // Keep the namespace even if it's 0 for empty prefixes.
                                        // This tells us we're not just a holdover from old links.
                                        $query['namespace'] = $namespace;
index 979c3ee..3fdaf6b 100644 (file)
@@ -40,7 +40,7 @@ class SpecialProtectedpages extends SpecialPage {
                $this->outputHeader();
 
                // Purge expired entries on one in every 10 queries
-               if( !mt_rand( 0, 10 ) ) {
+               if ( !mt_rand( 0, 10 ) ) {
                        Title::purgeExpiredRestrictions();
                }
 
@@ -57,7 +57,7 @@ class SpecialProtectedpages extends SpecialPage {
 
                $this->getOutput()->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly ) );
 
-               if( $pager->getNumRows() ) {
+               if ( $pager->getNumRows() ) {
                        $this->getOutput()->addHTML(
                                $pager->getNavigationBar() .
                                '<ul>' . $pager->getBody() . '</ul>' .
@@ -78,12 +78,12 @@ class SpecialProtectedpages extends SpecialPage {
 
                static $infinity = null;
 
-               if( is_null( $infinity ) ) {
+               if ( is_null( $infinity ) ) {
                        $infinity = wfGetDB( DB_SLAVE )->getInfinity();
                }
 
                $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
-               if( !$title ) {
+               if ( !$title ) {
                        wfProfileOut( __METHOD__ );
                        return Html::rawElement( 'li', array(),
                                Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
@@ -98,7 +98,7 @@ class SpecialProtectedpages extends SpecialPage {
 
                $description_items[] = $protType;
 
-               if( $row->pr_cascade ) {
+               if ( $row->pr_cascade ) {
                        $description_items[] = $this->msg( 'protect-summary-cascade' )->text();
                }
 
@@ -106,7 +106,7 @@ class SpecialProtectedpages extends SpecialPage {
                $lang = $this->getLanguage();
 
                $expiry = $lang->formatExpiry( $row->pr_expiry, TS_MW );
-               if( $expiry != $infinity ) {
+               if ( $expiry != $infinity ) {
                        $user = $this->getUser();
                        $description_items[] = $this->msg(
                                'protect-expiring-local',
@@ -116,12 +116,12 @@ class SpecialProtectedpages extends SpecialPage {
                        )->escaped();
                }
 
-               if( !is_null( $size = $row->page_len ) ) {
+               if ( !is_null( $size = $row->page_len ) ) {
                        $stxt = $lang->getDirMark() . ' ' . Linker::formatRevisionSize( $size );
                }
 
                # Show a link to the change protection form for allowed users otherwise a link to the protection log
-               if( $this->getUser()->isAllowed( 'protect' ) ) {
+               if ( $this->getUser()->isAllowed( 'protect' ) ) {
                        $changeProtection = Linker::linkKnown(
                                $title,
                                $this->msg( 'protect_change' )->escaped(),
@@ -248,13 +248,13 @@ class SpecialProtectedpages extends SpecialPage {
                $options = array();
 
                // First pass to load the log names
-               foreach( Title::getFilteredRestrictionTypes( true ) as $type ) {
+               foreach ( Title::getFilteredRestrictionTypes( true ) as $type ) {
                        $text = $this->msg( "restriction-$type" )->text();
                        $m[$text] = $type;
                }
 
                // Third pass generates sorted XHTML content
-               foreach( $m as $text => $type ) {
+               foreach ( $m as $text => $type ) {
                        $selected = ($type == $pr_type );
                        $options[] = Xml::option( $text, $type, $selected ) . "\n";
                }
@@ -278,17 +278,17 @@ class SpecialProtectedpages extends SpecialPage {
                $options = array();
 
                // First pass to load the log names
-               foreach( $wgRestrictionLevels as $type ) {
+               foreach ( $wgRestrictionLevels as $type ) {
                        // Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed'
-                       if( $type != '' && $type != '*' ) {
+                       if ( $type != '' && $type != '*' ) {
                                $text = $this->msg( "restriction-level-$type" )->text();
                                $m[$text] = $type;
                        }
                }
 
                // Third pass generates sorted XHTML content
-               foreach( $m as $text => $type ) {
-                       $selected = ($type == $pr_level );
+               foreach ( $m as $text => $type ) {
+                       $selected = ( $type == $pr_level );
                        $options[] = Xml::option( $text, $type, $selected );
                }
 
@@ -348,23 +348,25 @@ class ProtectedPagesPager extends AlphabeticPager {
                $conds[] = 'page_id=pr_page';
                $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
 
-               if( $this->sizetype == 'min' ) {
+               if ( $this->sizetype == 'min' ) {
                        $conds[] = 'page_len>=' . $this->size;
-               } elseif( $this->sizetype == 'max' ) {
+               } elseif ( $this->sizetype == 'max' ) {
                        $conds[] = 'page_len<=' . $this->size;
                }
 
-               if( $this->indefonly ) {
+               if ( $this->indefonly ) {
                        $conds[] = "pr_expiry = {$this->mDb->addQuotes( $this->mDb->getInfinity() )} OR pr_expiry IS NULL";
                }
-               if( $this->cascadeonly ) {
+               if ( $this->cascadeonly ) {
                        $conds[] = 'pr_cascade = 1';
                }
 
-               if( $this->level )
+               if ( $this->level ) {
                        $conds[] = 'pr_level=' . $this->mDb->addQuotes( $this->level );
-               if( !is_null( $this->namespace ) )
+               }
+               if ( !is_null( $this->namespace ) ) {
                        $conds[] = 'page_namespace=' . $this->mDb->addQuotes( $this->namespace );
+               }
                return array(
                        'tables' => array( 'page_restrictions', 'page' ),
                        'fields' => array( 'pr_id', 'page_namespace', 'page_title', 'page_len',
index cf2b272..7b916cf 100644 (file)
@@ -77,12 +77,12 @@ class SpecialProtectedtitles extends SpecialPage {
 
                static $infinity = null;
 
-               if( is_null( $infinity ) ) {
+               if ( is_null( $infinity ) ) {
                        $infinity = wfGetDB( DB_SLAVE )->getInfinity();
                }
 
                $title = Title::makeTitleSafe( $row->pt_namespace, $row->pt_title );
-               if( !$title ) {
+               if ( !$title ) {
                        wfProfileOut( __METHOD__ );
                        return Html::rawElement( 'li', array(),
                                Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
@@ -99,7 +99,7 @@ class SpecialProtectedtitles extends SpecialPage {
 
                $lang = $this->getLanguage();
                $expiry = strlen( $row->pt_expiry ) ? $lang->formatExpiry( $row->pt_expiry, TS_MW ) : $infinity;
-               if( $expiry != $infinity ) {
+               if ( $expiry != $infinity ) {
                        $user = $this->getUser();
                        $description_items[] = $this->msg(
                                'protect-expiring-local',
@@ -169,18 +169,18 @@ class SpecialProtectedtitles extends SpecialPage {
                $options = array();
 
                // First pass to load the log names
-               foreach( $wgRestrictionLevels as $type ) {
+               foreach ( $wgRestrictionLevels as $type ) {
                        if ( $type != '' && $type != '*' ) {
                                $text = $this->msg( "restriction-level-$type" )->text();
                                $m[$text] = $type;
                        }
                }
                // Is there only one level (aside from "all")?
-               if( count( $m ) <= 2 ) {
+               if ( count( $m ) <= 2 ) {
                        return '';
                }
                // Third pass generates sorted XHTML content
-               foreach( $m as $text => $type ) {
+               foreach ( $m as $text => $type ) {
                        $selected = ($type == $pr_level );
                        $options[] = Xml::option( $text, $type, $selected );
                }
@@ -244,10 +244,12 @@ class ProtectedTitlesPager extends AlphabeticPager {
        function getQueryInfo() {
                $conds = $this->mConds;
                $conds[] = 'pt_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() );
-               if( $this->level )
+               if ( $this->level ) {
                        $conds['pt_create_perm'] = $this->level;
-               if( !is_null( $this->namespace ) )
+               }
+               if ( !is_null( $this->namespace ) ) {
                        $conds[] = 'pt_namespace=' . $this->mDb->addQuotes( $this->namespace );
+               }
                return array(
                        'tables' => 'protected_titles',
                        'fields' => array( 'pt_namespace', 'pt_title', 'pt_create_perm',
index 2b25b78..dc4c1cd 100644 (file)
@@ -42,7 +42,7 @@ class RandomPage extends SpecialPage {
        }
 
        public function setNamespace( $ns ) {
-               if( !$ns || $ns < NS_MAIN ) {
+               if ( !$ns || $ns < NS_MAIN ) {
                        $ns = NS_MAIN;
                }
                $this->namespaces = array( $ns );
@@ -62,7 +62,7 @@ class RandomPage extends SpecialPage {
 
                $title = $this->getRandomTitle();
 
-               if( is_null( $title ) ) {
+               if ( is_null( $title ) ) {
                        $this->setHeaders();
                        $this->getOutput()->addWikiMsg( strtolower( $this->getName() ) . '-nopages',
                                $this->getNsList(), count( $this->namespaces ) );
@@ -83,8 +83,8 @@ class RandomPage extends SpecialPage {
        private function getNsList() {
                global $wgContLang;
                $nsNames = array();
-               foreach( $this->namespaces as $n ) {
-                       if( $n === NS_MAIN ) {
+               foreach ( $this->namespaces as $n ) {
+                       if ( $n === NS_MAIN ) {
                                $nsNames[] = $this->msg( 'blanknamespace' )->plain();
                        } else {
                                $nsNames[] = $wgContLang->getNsText( $n );
@@ -113,11 +113,11 @@ class RandomPage extends SpecialPage {
                 * any more bias than what the page_random scheme
                 * causes anyway.  Trust me, I'm a mathematician. :)
                 */
-               if( !$row ) {
+               if ( !$row ) {
                        $row = $this->selectRandomPageFromDB( "0" );
                }
 
-               if( $row ) {
+               if ( $row ) {
                        return Title::makeTitleSafe( $row->page_namespace, $row->page_title );
                } else {
                        return null;
index 6772cb5..c37f216 100644 (file)
@@ -73,14 +73,14 @@ class SpecialRecentChanges extends IncludableSpecialPage {
        public function setup( $parameters ) {
                $opts = $this->getDefaultOptions();
 
-               foreach( $this->getCustomFilters() as $key => $params ) {
+               foreach ( $this->getCustomFilters() as $key => $params ) {
                        $opts->add( $key, $params['default'] );
                }
 
                $opts->fetchValuesFromRequest( $this->getRequest() );
 
                // Give precedence to subpage syntax
-               if( $parameters !== null ) {
+               if ( $parameters !== null ) {
                        $this->parseParameters( $parameters, $opts );
                }
 
@@ -142,7 +142,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $this->getOutput()->setSquidMaxage( 10 );
                # Check if the client has a cached version
                $lastmod = $this->checkLastModified( $feedFormat );
-               if( $lastmod === false ) {
+               if ( $lastmod === false ) {
                        return;
                }
 
@@ -154,23 +154,23 @@ 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( !$this->including() ) {
+               if ( $rows === false ) {
+                       if ( !$this->including() ) {
                                $this->doHeader( $opts );
                        }
                        return;
                }
 
-               if( !$feedFormat ) {
+               if ( !$feedFormat ) {
                        $batch = new LinkBatch;
-                       foreach( $rows as $row ) {
+                       foreach ( $rows as $row ) {
                                $batch->add( NS_USER, $row->rc_user_text );
                                $batch->add( NS_USER_TALK, $row->rc_user_text );
                                $batch->add( $row->rc_namespace, $row->rc_title );
                        }
                        $batch->execute();
                }
-               if( $feedFormat ) {
+               if ( $feedFormat ) {
                        list( $changesFeed, $formatter ) = $this->getFeedObject( $feedFormat );
                        /** @var ChangesFeed $changesFeed */
                        $changesFeed->execute( $formatter, $rows, $lastmod, $opts );
@@ -206,44 +206,44 @@ class SpecialRecentChanges extends IncludableSpecialPage {
         */
        public function parseParameters( $par, FormOptions $opts ) {
                $bits = preg_split( '/\s*,\s*/', trim( $par ) );
-               foreach( $bits as $bit ) {
-                       if( 'hidebots' === $bit ) {
+               foreach ( $bits as $bit ) {
+                       if ( 'hidebots' === $bit ) {
                                $opts['hidebots'] = true;
                        }
-                       if( 'bots' === $bit ) {
+                       if ( 'bots' === $bit ) {
                                $opts['hidebots'] = false;
                        }
-                       if( 'hideminor' === $bit ) {
+                       if ( 'hideminor' === $bit ) {
                                $opts['hideminor'] = true;
                        }
-                       if( 'minor' === $bit ) {
+                       if ( 'minor' === $bit ) {
                                $opts['hideminor'] = false;
                        }
-                       if( 'hideliu' === $bit ) {
+                       if ( 'hideliu' === $bit ) {
                                $opts['hideliu'] = true;
                        }
-                       if( 'hidepatrolled' === $bit ) {
+                       if ( 'hidepatrolled' === $bit ) {
                                $opts['hidepatrolled'] = true;
                        }
-                       if( 'hideanons' === $bit ) {
+                       if ( 'hideanons' === $bit ) {
                                $opts['hideanons'] = true;
                        }
-                       if( 'hidemyself' === $bit ) {
+                       if ( 'hidemyself' === $bit ) {
                                $opts['hidemyself'] = true;
                        }
 
-                       if( is_numeric( $bit ) ) {
+                       if ( is_numeric( $bit ) ) {
                                $opts['limit'] = $bit;
                        }
 
                        $m = array();
-                       if( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) {
+                       if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) {
                                $opts['limit'] = $m[1];
                        }
-                       if( preg_match( '/^days=(\d+)$/', $bit, $m ) ) {
+                       if ( preg_match( '/^days=(\d+)$/', $bit, $m ) ) {
                                $opts['days'] = $m[1];
                        }
-                       if( preg_match( '/^namespace=(\d+)$/', $bit, $m ) ) {
+                       if ( preg_match( '/^namespace=(\d+)$/', $bit, $m ) ) {
                                $opts['namespace'] = $m[1];
                        }
                }
@@ -260,8 +260,8 @@ class SpecialRecentChanges extends IncludableSpecialPage {
        public function checkLastModified( $feedFormat ) {
                $dbr = wfGetDB( DB_SLAVE );
                $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__ );
-               if( $feedFormat || !$this->getUser()->useRCPatrol() ) {
-                       if( $lastmod && $this->getOutput()->checkLastModified( $lastmod ) ) {
+               if ( $feedFormat || !$this->getUser()->useRCPatrol() ) {
+                       if ( $lastmod && $this->getOutput()->checkLastModified( $lastmod ) ) {
                                # Client cache fresh and headers sent, nothing more to do.
                                return false;
                        }
@@ -282,9 +282,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;
@@ -298,7 +298,7 @@ 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 ) ) {
+               if ( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) {
                        $cutoff = $dbr->timestamp( $opts['from'] );
                } else {
                        $opts->reset( 'from' );
@@ -310,27 +310,27 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $hideLoggedInUsers = $opts['hideliu'] && !$forcebot;
                $hideAnonymousUsers = $opts['hideanons'] && !$forcebot;
 
-               if( $opts['hideminor'] ) {
+               if ( $opts['hideminor'] ) {
                        $conds['rc_minor'] = 0;
                }
-               if( $opts['hidebots'] ) {
+               if ( $opts['hidebots'] ) {
                        $conds['rc_bot'] = 0;
                }
-               if( $hidePatrol ) {
+               if ( $hidePatrol ) {
                        $conds['rc_patrolled'] = 0;
                }
-               if( $forcebot ) {
+               if ( $forcebot ) {
                        $conds['rc_bot'] = 1;
                }
-               if( $hideLoggedInUsers ) {
+               if ( $hideLoggedInUsers ) {
                        $conds[] = 'rc_user = 0';
                }
-               if( $hideAnonymousUsers ) {
+               if ( $hideAnonymousUsers ) {
                        $conds[] = 'rc_user != 0';
                }
 
-               if( $opts['hidemyself'] ) {
-                       if( $this->getUser()->getId() ) {
+               if ( $opts['hidemyself'] ) {
+                       if ( $this->getUser()->getId() ) {
                                $conds[] = 'rc_user != ' . $dbr->addQuotes( $this->getUser()->getId() );
                        } else {
                                $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $this->getUser()->getName() );
@@ -338,13 +338,13 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                }
 
                # Namespace filtering
-               if( $opts['namespace'] !== '' ) {
+               if ( $opts['namespace'] !== '' ) {
                        $selectedNS = $dbr->addQuotes( $opts['namespace'] );
                        $operator = $opts['invert'] ? '!='  : '=';
                        $boolean = $opts['invert'] ? 'AND' : 'OR';
 
                        # namespace association (bug 2429)
-                       if( !$opts['associated'] ) {
+                       if ( !$opts['associated'] ) {
                                $condition = "rc_namespace $operator $selectedNS";
                        } else {
                                # Also add the associated namespace
@@ -420,7 +420,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                // (b) We want pages in more than one namespace (inverted/associated)
                // (c) There is a tag to filter on (use tag index instead)
                // (d) UNION + sort/limit is not an option for the DBMS
-               if( $namespace === ''
+               if ( $namespace === ''
                        || ( $invert || $associated )
                        || $opts['tagfilter'] != ''
                        || !$dbr->unionSupportsOrderAndLimit() )
@@ -478,7 +478,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                $limit = $opts['limit'];
 
-               if( !$this->including() ) {
+               if ( !$this->including() ) {
                        // Output options box
                        $this->doHeader( $opts );
                }
@@ -491,7 +491,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $this->getOutput()->setFeedAppendQuery( false );
                }
 
-               if( $wgAllowCategorizedRecentChanges ) {
+               if ( $wgAllowCategorizedRecentChanges ) {
                        $this->filterByCategories( $rows, $opts );
                }
 
@@ -504,22 +504,22 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $list = ChangesList::newFromContext( $this->getContext() );
 
                $s = $list->beginRecentChangesList();
-               foreach( $rows as $obj ) {
-                       if( $limit == 0 ) {
+               foreach ( $rows as $obj ) {
+                       if ( $limit == 0 ) {
                                break;
                        }
                        $rc = RecentChange::newFromRow( $obj );
                        $rc->counter = $counter++;
                        # Check if the page has been updated since the last visit
-                       if( $wgShowUpdatedMarker && !empty( $obj->wl_notificationtimestamp ) ) {
+                       if ( $wgShowUpdatedMarker && !empty( $obj->wl_notificationtimestamp ) ) {
                                $rc->notificationtimestamp = ( $obj->rc_timestamp >= $obj->wl_notificationtimestamp );
                        } else {
                                $rc->notificationtimestamp = false; // Default
                        }
                        # Check the number of users watching the page
                        $rc->numberofWatchingusers = 0; // Default
-                       if( $showWatcherCount && $obj->rc_namespace >= 0 ) {
-                               if( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) {
+                       if ( $showWatcherCount && $obj->rc_namespace >= 0 ) {
+                               if ( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) {
                                        $watcherCache[$obj->rc_namespace][$obj->rc_title] =
                                                $dbr->selectField(
                                                        'watchlist',
@@ -594,13 +594,13 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $submit = ' ' . Xml::submitbutton( $this->msg( 'allpagessubmit' )->text() );
 
                $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
-               foreach( $extraOpts as $name => $optionRow ) {
+               foreach ( $extraOpts as $name => $optionRow ) {
                        # Add submit button to the last row only
                        ++$count;
                        $addSubmit = ( $count === $extraOptsCount ) ? $submit : '';
 
                        $out .= Xml::openElement( 'tr' );
-                       if( is_array( $optionRow ) ) {
+                       if ( is_array( $optionRow ) ) {
                                $out .= Xml::tags( 'td', array( 'class' => 'mw-label mw-' . $name . '-label' ), $optionRow[0] );
                                $out .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $optionRow[1] . $addSubmit );
                        } else {
@@ -611,7 +611,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $out .= Xml::closeElement( 'table' );
 
                $unconsumed = $opts->getUnconsumedValues();
-               foreach( $unconsumed as $key => $value ) {
+               foreach ( $unconsumed as $key => $value ) {
                        $out .= Html::hidden( $key, $value );
                }
 
@@ -639,7 +639,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
 
                global $wgAllowCategorizedRecentChanges;
-               if( $wgAllowCategorizedRecentChanges ) {
+               if ( $wgAllowCategorizedRecentChanges ) {
                        $extraOpts['category'] = $this->categoryFilterForm( $opts );
                }
 
@@ -732,15 +732,15 @@ class SpecialRecentChanges extends IncludableSpecialPage {
        function filterByCategories( &$rows, FormOptions $opts ) {
                $categories = array_map( 'trim', explode( '|', $opts['categories'] ) );
 
-               if( !count( $categories ) ) {
+               if ( !count( $categories ) ) {
                        return;
                }
 
                # Filter categories
                $cats = array();
-               foreach( $categories as $cat ) {
+               foreach ( $categories as $cat ) {
                        $cat = trim( $cat );
-                       if( $cat == '' ) {
+                       if ( $cat == '' ) {
                                continue;
                        }
                        $cats[] = $cat;
@@ -750,16 +750,16 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $articles = array();
                $a2r = array();
                $rowsarr = array();
-               foreach( $rows as $k => $r ) {
+               foreach ( $rows as $k => $r ) {
                        $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title );
                        $id = $nt->getArticleID();
-                       if( $id == 0 ) {
+                       if ( $id == 0 ) {
                                continue; # Page might have been deleted...
                        }
-                       if( !in_array( $id, $articles ) ) {
+                       if ( !in_array( $id, $articles ) ) {
                                $articles[] = $id;
                        }
-                       if( !isset( $a2r[$id] ) ) {
+                       if ( !isset( $a2r[$id] ) ) {
                                $a2r[$id] = array();
                        }
                        $a2r[$id][] = $k;
@@ -767,7 +767,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                }
 
                # Shortcut?
-               if( !count( $articles ) || !count( $cats ) ) {
+               if ( !count( $articles ) || !count( $cats ) ) {
                        return;
                }
 
@@ -778,8 +778,8 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                # Filter
                $newrows = array();
-               foreach( $match as $id ) {
-                       foreach( $a2r[$id] as $rev ) {
+               foreach ( $match as $id ) {
+                       foreach ( $a2r[$id] as $rev ) {
                                $k = $rev;
                                $newrows[$k] = $rowsarr[$k];
                        }
@@ -829,13 +829,13 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                $note = '';
                $msg = $this->msg( 'rclegend' );
-               if( !$msg->isDisabled() ) {
+               if ( !$msg->isDisabled() ) {
                        $note .= '<div class="mw-rclegend">' . $msg->parse() . "</div>\n";
                }
 
                $lang = $this->getLanguage();
                $user = $this->getUser();
-               if( $options['from'] ) {
+               if ( $options['from'] ) {
                        $note .= $this->msg( 'rcnotefrom' )->numParams( $options['limit'] )->params(
                                $lang->userTimeAndDate( $options['from'], $user ),
                                $lang->userDate( $options['from'], $user ),
@@ -852,7 +852,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                // limit links
                $cl = array();
-               foreach( $wgRCLinkLimits as $value ) {
+               foreach ( $wgRCLinkLimits as $value ) {
                        $cl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
                                array( 'limit' => $value ), $nondefaults, $value == $options['limit'] );
                }
@@ -860,7 +860,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                // day links, reset 'from' to none
                $dl = array();
-               foreach( $wgRCLinkDays as $value ) {
+               foreach ( $wgRCLinkDays as $value ) {
                        $dl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
                                array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] );
                }
@@ -869,12 +869,12 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                // show/hide links
                $showhide = array( $this->msg( 'show' )->text(), $this->msg( 'hide' )->text() );
                $filters = array(
-                       'hideminor'     => 'rcshowhideminor',
-                       'hidebots'      => 'rcshowhidebots',
-                       'hideanons'     => 'rcshowhideanons',
-                       'hideliu'       => 'rcshowhideliu',
+                       'hideminor' => 'rcshowhideminor',
+                       'hidebots' => 'rcshowhidebots',
+                       'hideanons' => 'rcshowhideanons',
+                       'hideliu' => 'rcshowhideliu',
                        'hidepatrolled' => 'rcshowhidepatr',
-                       'hidemyself'    => 'rcshowhidemine'
+                       'hidemyself' => 'rcshowhidemine'
                );
                foreach ( $this->getCustomFilters() as $key => $params ) {
                        $filters[$key] = $params['msg'];
index bdeb770..062e09d 100644 (file)
@@ -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;
                }
@@ -99,7 +99,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
 
                // left join with watchlist table to highlight watched rows
                $uid = $this->getUser()->getId();
-               if( $uid ) {
+               if ( $uid ) {
                        $tables[] = 'watchlist';
                        $select[] = 'wl_user';
                        $join_conds['watchlist'] = array( 'LEFT JOIN', array(
@@ -126,7 +126,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                        return false;
                }
 
-               if( $ns == NS_CATEGORY && !$showlinkedto ) {
+               if ( $ns == NS_CATEGORY && !$showlinkedto ) {
                        // special handling for categories
                        // XXX: should try to make this less kludgy
                        $link_tables = array( 'categorylinks' );
@@ -135,12 +135,12 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                        // for now, always join on these tables; really should be configurable as in whatlinkshere
                        $link_tables = array( 'pagelinks', 'templatelinks' );
                        // imagelinks only contains links to pages in NS_FILE
-                       if( $ns == NS_FILE || !$showlinkedto ) {
+                       if ( $ns == NS_FILE || !$showlinkedto ) {
                                $link_tables[] = 'imagelinks';
                        }
                }
 
-               if( $id == 0 && !$showlinkedto ) {
+               if ( $id == 0 && !$showlinkedto ) {
                        return false; // nonexistent pages can't link to any pages
                }
 
@@ -149,22 +149,22 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
 
                $subsql = array(); // SELECT statements to combine with UNION
 
-               foreach( $link_tables as $link_table ) {
+               foreach ( $link_tables as $link_table ) {
                        $pfx = $prefix[$link_table];
 
                        // imagelinks and categorylinks tables have no xx_namespace field, and have xx_to instead of xx_title
-                       if( $link_table == 'imagelinks' ) {
+                       if ( $link_table == 'imagelinks' ) {
                                $link_ns = NS_FILE;
-                       } elseif( $link_table == 'categorylinks' ) {
+                       } elseif ( $link_table == 'categorylinks' ) {
                                $link_ns = NS_CATEGORY;
                        } else {
                                $link_ns = 0;
                        }
 
-                       if( $showlinkedto ) {
+                       if ( $showlinkedto ) {
                                // find changes to pages linking to this page
-                               if( $link_ns ) {
-                                       if( $ns != $link_ns ) {
+                               if ( $link_ns ) {
+                                       if ( $ns != $link_ns ) {
                                                continue;
                                        } // should never happen, but check anyway
                                        $subconds = array( "{$pfx}_to" => $dbkey );
@@ -175,7 +175,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                        } else {
                                // find changes to pages linked from this page
                                $subconds = array( "{$pfx}_from" => $id );
-                               if( $link_table == 'imagelinks' || $link_table == 'categorylinks' ) {
+                               if ( $link_table == 'imagelinks' || $link_table == 'categorylinks' ) {
                                        $subconds["rc_namespace"] = $link_ns;
                                        $subjoin = "rc_title = {$pfx}_to";
                                } else {
@@ -183,7 +183,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                                }
                        }
 
-                       if( $dbr->unionSupportsOrderAndLimit() ) {
+                       if ( $dbr->unionSupportsOrderAndLimit() ) {
                                $order = array( 'ORDER BY' => 'rc_timestamp DESC' );
                        } else {
                                $order = array();
@@ -198,16 +198,17 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                                $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) )
                        );
 
-                       if( $dbr->unionSupportsOrderAndLimit() )
+                       if ( $dbr->unionSupportsOrderAndLimit() ) {
                                $query = $dbr->limitResult( $query, $limit );
+                       }
 
                        $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
@@ -217,7 +218,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
 
                $res = $dbr->query( $sql, __METHOD__ );
 
-               if( $res->numRows() == 0 ) {
+               if ( $res->numRows() == 0 ) {
                        $this->mResultEmpty = true;
                }
 
@@ -260,13 +261,13 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
 
        function setTopText( FormOptions $opts ) {
                $target = $this->getTargetTitle();
-               if( $target ) {
+               if ( $target ) {
                        $this->getOutput()->addBacklinkSubtitle( $target );
                }
        }
 
        function setBottomText( FormOptions $opts ) {
-               if( isset( $this->mResultEmpty ) && $this->mResultEmpty ) {
+               if ( isset( $this->mResultEmpty ) && $this->mResultEmpty ) {
                        $this->getOutput()->addWikiMsg( 'recentchangeslinked-noresult' );
                }
        }
index 3a7399a..771132a 100644 (file)
@@ -76,7 +76,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        'list-class'    => 'RevDel_ArchiveList',
                        'permission'    => 'deleterevision',
                ),
-               'oldimage'=> array(
+               'oldimage' => array(
                        'check-label'   => 'revdelete-hide-image',
                        'deletion-bits' => File::DELETED_FILE,
                        'success'               => 'revdelete-success',
@@ -175,7 +175,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                }
 
                # No targets?
-               if( !isset( self::$allowedTypes[$this->typeName] ) || count( $this->ids ) == 0 ) {
+               if ( !isset( self::$allowedTypes[$this->typeName] ) || count( $this->ids ) == 0 ) {
                        throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
                }
                $this->typeInfo = self::$allowedTypes[$this->typeName];
@@ -184,14 +184,14 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                # If we have revisions, get the title from the first one
                # since they should all be from the same page. This allows
                # for more flexibility with page moves...
-               if( $this->typeName == 'revision' ) {
+               if ( $this->typeName == 'revision' ) {
                        $rev = Revision::newFromId( $this->ids[0] );
                        $this->targetObj = $rev ? $rev->getTitle() : $this->targetObj;
                }
 
                $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,13 +204,13 @@ 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 );
                }
 
                # Either submit or create our form
-               if( $this->mIsAllowed && $this->submitClicked ) {
+               if ( $this->mIsAllowed && $this->submitClicked ) {
                        $this->submit( $request );
                } else {
                        $this->showForm();
@@ -223,7 +223,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                LogEventsList::showLogExtract( $output, 'delete',
                        $this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
                # Show relevant lines from the suppression log
-               if( $user->isAllowed( 'suppressionlog' ) ) {
+               if ( $user->isAllowed( 'suppressionlog' ) ) {
                        $suppressLogPage = new LogPage( 'suppress' );
                        $output->addHTML( "<h2>" . $suppressLogPage->getName()->escaped() . "</h2>\n" );
                        LogEventsList::showLogExtract( $output, 'suppress',
@@ -236,7 +236,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         */
        protected function showConvenienceLinks() {
                # Give a link to the logs/hist for this page
-               if( $this->targetObj ) {
+               if ( $this->targetObj ) {
                        $links = array();
                        $links[] = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Log' ),
@@ -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,
@@ -296,8 +296,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        return;
                }
                $user = $this->getUser();
-               if( !$oimage->userCan( File::DELETED_FILE, $user ) ) {
-                       if( $oimage->isDeleted( File::DELETED_RESTRICTED ) ) {
+               if ( !$oimage->userCan( File::DELETED_FILE, $user ) ) {
+                       if ( $oimage->isDeleted( File::DELETED_RESTRICTED ) ) {
                                throw new PermissionsError( 'suppressrevision' );
                        } else {
                                throw new PermissionsError( 'deletedtext' );
@@ -370,7 +370,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                for ( $list->reset(); $list->current(); $list->next() ) {
                        $item = $list->current();
                        if ( !$item->canView() ) {
-                               if( !$this->submitClicked ) {
+                               if ( !$this->submitClicked ) {
                                        throw new PermissionsError( 'suppressrevision' );
                                }
                                $UserAllowed = false;
@@ -379,7 +379,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $this->getOutput()->addHTML( $item->getHTML() );
                }
 
-               if( !$numRevisions ) {
+               if ( !$numRevisions ) {
                        throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
                }
 
@@ -388,10 +388,12 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $this->addUsageText();
 
                // Normal sysops can always see what they did, but can't always change it
-               if( !$UserAllowed ) return;
+               if ( !$UserAllowed ) {
+                       return;
+               }
 
                // Show form if the user can submit
-               if( $this->mIsAllowed ) {
+               if ( $this->mIsAllowed ) {
                        $out = Xml::openElement( 'form', array( 'method' => 'post',
                                        'action' => $this->getTitle()->getLocalURL( array( 'action' => 'submit' ) ),
                                        'id' => 'mw-revdel-form-revisions' ) ) .
@@ -432,10 +434,10 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                } else {
                        $out = '';
                }
-               if( $this->mIsAllowed ) {
+               if ( $this->mIsAllowed ) {
                        $out .= Xml::closeElement( 'form' ) . "\n";
                        // Show link to edit the dropdown reasons
-                       if( $this->getUser()->isAllowed( 'editinterface' ) ) {
+                       if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
                                $title = Title::makeTitle( NS_MEDIAWIKI, 'Revdelete-reason-dropdown' );
                                $link = Linker::link(
                                        $title,
@@ -455,10 +457,10 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         */
        protected function addUsageText() {
                $this->getOutput()->addWikiMsg( 'revdelete-text' );
-               if( $this->getUser()->isAllowed( 'suppressrevision' ) ) {
+               if ( $this->getUser()->isAllowed( 'suppressrevision' ) ) {
                        $this->getOutput()->addWikiMsg( 'revdelete-suppress-text' );
                }
-               if( $this->mIsAllowed ) {
+               if ( $this->mIsAllowed ) {
                        $this->getOutput()->addWikiMsg( 'revdelete-confirm' );
                }
        }
@@ -470,17 +472,18 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $html = '<table>';
                // If there is just one item, use checkboxes
                $list = $this->getList();
-               if( $list->length() == 1 ) {
+               if ( $list->length() == 1 ) {
                        $list->reset();
                        $bitfield = $list->current()->getBits(); // existing field
-                       if( $this->submitClicked ) {
+                       if ( $this->submitClicked ) {
                                $bitfield = $this->extractBitfield( $this->extractBitParams(), $bitfield );
                        }
-                       foreach( $this->checks as $item ) {
+                       foreach ( $this->checks as $item ) {
                                list( $message, $name, $field ) = $item;
                                $innerHTML = Xml::checkLabel( $this->msg( $message )->text(), $name, $name, $bitfield & $field );
-                               if( $field == Revision::DELETED_RESTRICTED )
+                               if ( $field == Revision::DELETED_RESTRICTED ) {
                                        $innerHTML = "<b>$innerHTML</b>";
+                               }
                                $line = Xml::tags( 'td', array( 'class' => 'mw-input' ), $innerHTML );
                                $html .= "<tr>$line</tr>\n";
                        }
@@ -491,10 +494,10 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-unset' )->escaped() . '</th>';
                        $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-set' )->escaped() . '</th>';
                        $html .= "<th></th></tr>\n";
-                       foreach( $this->checks as $item ) {
+                       foreach ( $this->checks as $item ) {
                                list( $message, $name, $field ) = $item;
                                // If there are several items, use third state by default...
-                               if( $this->submitClicked ) {
+                               if ( $this->submitClicked ) {
                                        $selected = $this->getRequest()->getInt( $name, 0 /* unchecked */ );
                                } else {
                                        $selected = -1; // use existing field
@@ -503,7 +506,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                $line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 0, $selected == 0 ) . '</td>';
                                $line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 1, $selected == 1 ) . '</td>';
                                $label = $this->msg( $message )->escaped();
-                               if( $field == Revision::DELETED_RESTRICTED ) {
+                               if ( $field == Revision::DELETED_RESTRICTED ) {
                                        $label = "<b>$label</b>";
                                }
                                $line .= "<td>$label</td>";
@@ -523,21 +526,21 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        protected function submit() {
                # Check edit token on submission
                $token = $this->getRequest()->getVal( 'wpEditToken' );
-               if( $this->submitClicked && !$this->getUser()->matchEditToken( $token ) ) {
+               if ( $this->submitClicked && !$this->getUser()->matchEditToken( $token ) ) {
                        $this->getOutput()->addWikiMsg( 'sessionfailure' );
                        return false;
                }
                $bitParams = $this->extractBitParams();
                $listReason = $this->getRequest()->getText( 'wpRevDeleteReasonList', 'other' ); // from dropdown
                $comment = $listReason;
-               if( $comment != 'other' && $this->otherReason != '' ) {
+               if ( $comment != 'other' && $this->otherReason != '' ) {
                        // Entry from drop down menu + additional comment
                        $comment .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->otherReason;
-               } elseif( $comment == 'other' ) {
+               } elseif ( $comment == 'other' ) {
                        $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...
@@ -578,15 +581,15 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
         */
        protected function extractBitParams() {
                $bitfield = array();
-               foreach( $this->checks as $item ) {
+               foreach ( $this->checks as $item ) {
                        list( /* message */, $name, $field ) = $item;
                        $val = $this->getRequest()->getInt( $name, 0 /* unchecked */ );
-                       if( $val < -1 || $val > 1 ) {
+                       if ( $val < -1 || $val > 1 ) {
                                $val = -1; // -1 for existing value
                        }
                        $bitfield[$field] = $val;
                }
-               if( !isset( $bitfield[Revision::DELETED_RESTRICTED] ) ) {
+               if ( !isset( $bitfield[Revision::DELETED_RESTRICTED] ) ) {
                        $bitfield[Revision::DELETED_RESTRICTED] = 0;
                }
                return $bitfield;
@@ -601,10 +604,10 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        public static function extractBitfield( $bitPars, $oldfield ) {
                // Build the actual new rev_deleted bitfield
                $newBits = 0;
-               foreach( $bitPars as $const => $val ) {
-                       if( $val == 1 ) {
+               foreach ( $bitPars as $const => $val ) {
+                       if ( $val == 1 ) {
                                $newBits |= $const; // $const is the *_deleted const
-                       } elseif( $val == -1 ) {
+                       } elseif ( $val == -1 ) {
                                $newBits |= ($oldfield & $const); // use existing
                        }
                }
index 644a575..94995db 100644 (file)
@@ -137,7 +137,7 @@ class SpecialSearch extends SpecialPage {
                if ( $profile === null ) {
                        // BC with old request format
                        $profile = 'advanced';
-                       foreach( $profiles as $key => $data ) {
+                       foreach ( $profiles as $key => $data ) {
                                if ( $nslist === $data['namespaces'] && $key !== 'advanced' ) {
                                        $profile = $key;
                                }
@@ -173,7 +173,7 @@ class SpecialSearch extends SpecialPage {
                # Try to go to page as entered.
                $t = Title::newFromText( $term );
                # If the string cannot be used to create a title
-               if( is_null( $t ) ) {
+               if ( is_null( $t ) ) {
                        $this->showResults( $term );
                        return;
                }
@@ -185,19 +185,19 @@ class SpecialSearch extends SpecialPage {
                        return;
                }
 
-               if( !is_null( $t ) ) {
+               if ( !is_null( $t ) ) {
                        $this->getOutput()->redirect( $t->getFullURL() );
                        return;
                }
                # No match, generate an edit URL
                $t = Title::newFromText( $term );
-               if( !is_null( $t ) ) {
+               if ( !is_null( $t ) ) {
                        global $wgGoToEdit;
                        wfRunHooks( 'SpecialSearchNogomatch', array( &$t ) );
                        wfDebugLog( 'nogomatch', $t->getText(), false );
 
                        # If the feature is enabled, go straight to the edit page
-                       if( $wgGoToEdit ) {
+                       if ( $wgGoToEdit ) {
                                $this->getOutput()->redirect( $t->getFullURL( array( 'action' => 'edit' ) ) );
                                return;
                        }
@@ -253,24 +253,24 @@ class SpecialSearch extends SpecialPage {
                $rewritten = $search->replacePrefixes( $term );
 
                $titleMatches = $search->searchTitle( $rewritten );
-               if( !( $titleMatches instanceof SearchResultTooMany ) ) {
+               if ( !( $titleMatches instanceof SearchResultTooMany ) ) {
                        $textMatches = $search->searchText( $rewritten );
                }
 
                $textStatus = null;
-               if( $textMatches instanceof Status ) {
+               if ( $textMatches instanceof Status ) {
                        $textStatus = $textMatches;
                        $textMatches = null;
                }
 
                // did you mean... suggestions
-               if( $textMatches && !$textStatus && $textMatches->hasSuggestion() ) {
+               if ( $textMatches && !$textStatus && $textMatches->hasSuggestion() ) {
                        $st = SpecialPage::getTitleFor( 'Search' );
 
                        # mirror Go/Search behavior of original request ..
                        $didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() );
 
-                       if( $this->fulltext != null ) {
+                       if ( $this->fulltext != null ) {
                                $didYouMeanParams['fulltext'] = $this->fulltext;
                        }
 
@@ -281,7 +281,7 @@ class SpecialSearch extends SpecialPage {
 
                        $suggestionSnippet = $textMatches->getSuggestionSnippet();
 
-                       if( $suggestionSnippet == '' ) {
+                       if ( $suggestionSnippet == '' ) {
                                $suggestionSnippet = null;
                        }
 
@@ -323,14 +323,14 @@ class SpecialSearch extends SpecialPage {
                );
 
                // Sometimes the search engine knows there are too many hits
-               if( $titleMatches instanceof SearchResultTooMany ) {
+               if ( $titleMatches instanceof SearchResultTooMany ) {
                        $out->wrapWikiMsg( "==$1==\n", 'toomanymatches' );
                        wfProfileOut( __METHOD__ );
                        return;
                }
 
                $filePrefix = $wgContLang->getFormattedNsText( NS_FILE ) . ':';
-               if( trim( $term ) === '' || $filePrefix === trim( $term ) ) {
+               if ( trim( $term ) === '' || $filePrefix === trim( $term ) ) {
                        $out->addHTML( $this->formHeader( $term, 0, 0 ) );
                        $out->addHtml( $this->getProfileForm( $this->profile, $term ) );
                        $out->addHTML( '</form>' );
@@ -353,10 +353,12 @@ 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
                $out->addHTML( $this->formHeader( $term, $num, $totalRes ) );
@@ -366,7 +368,7 @@ class SpecialSearch extends SpecialPage {
                $out->addHtml( "<div class='searchresults'>" );
 
                // prev/next links
-               if( $num || $this->offset ) {
+               if ( $num || $this->offset ) {
                        // Show the create link ahead
                        $this->showCreateLink( $t );
                        $prevnext = $this->getLanguage()->viewPrevNext( $this->getTitle(), $this->offset, $this->limit,
@@ -380,34 +382,34 @@ class SpecialSearch extends SpecialPage {
                }
 
                $out->parserOptions()->setEditSection( false );
-               if( $titleMatches ) {
-                       if( $numTitleMatches > 0 ) {
+               if ( $titleMatches ) {
+                       if ( $numTitleMatches > 0 ) {
                                $out->wrapWikiMsg( "==$1==\n", 'titlematches' );
                                $out->addHTML( $this->showMatches( $titleMatches ) );
                        }
                        $titleMatches->free();
                }
-               if( $textMatches && !$textStatus ) {
+               if ( $textMatches && !$textStatus ) {
                        // output appropriate heading
-                       if( $numTextMatches > 0 && $numTitleMatches > 0 ) {
+                       if ( $numTextMatches > 0 && $numTitleMatches > 0 ) {
                                // if no title matches the heading is redundant
                                $out->wrapWikiMsg( "==$1==\n", 'textmatches' );
-                       } elseif( $totalRes == 0 ) {
+                       } elseif ( $totalRes == 0 ) {
                                # Don't show the 'no text matches' if we received title matches
                                # $out->wrapWikiMsg( "==$1==\n", 'notextmatches' );
                        }
                        // show interwiki results if any
-                       if( $textMatches->hasInterwikiResults() ) {
+                       if ( $textMatches->hasInterwikiResults() ) {
                                $out->addHTML( $this->showInterwiki( $textMatches->getInterwikiResults(), $term ) );
                        }
                        // show results
-                       if( $numTextMatches > 0 ) {
+                       if ( $numTextMatches > 0 ) {
                                $out->addHTML( $this->showMatches( $textMatches ) );
                        }
 
                        $textMatches->free();
                }
-               if( $num === 0 ) {
+               if ( $num === 0 ) {
                        if ( $textStatus ) {
                                $out->addHTML( '<div class="error">' .
                                        htmlspecialchars( $textStatus->getWikiText( 'search-error' ) ) . '</div>' );
@@ -419,7 +421,7 @@ class SpecialSearch extends SpecialPage {
                }
                $out->addHtml( "</div>" );
 
-               if( $num || $this->offset ) {
+               if ( $num || $this->offset ) {
                        $out->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" );
                }
                wfRunHooks( 'SpecialSearchResultsAppend', array( $this, $out, $term ) );
@@ -433,16 +435,16 @@ class SpecialSearch extends SpecialPage {
                // show direct page/create link if applicable
 
                // Check DBkey !== '' in case of fragment link only.
-               if( is_null( $t ) || $t->getDBkey() === '' ) {
+               if ( is_null( $t ) || $t->getDBkey() === '' ) {
                        // invalid title
                        // preserve the paragraph for margins etc...
                        $this->getOutput()->addHtml( '<p></p>' );
                        return;
                }
 
-               if( $t->isKnown() ) {
+               if ( $t->isKnown() ) {
                        $messageName = 'searchmenu-exists';
-               } elseif( $t->userCan( 'create', $this->getUser() ) ) {
+               } elseif ( $t->userCan( 'create', $this->getUser() ) ) {
                        $messageName = 'searchmenu-new';
                } else {
                        $messageName = 'searchmenu-new-nocreate';
@@ -451,7 +453,7 @@ class SpecialSearch extends SpecialPage {
                wfRunHooks( 'SpecialSearchCreateLink', array( $t, &$params ) );
 
                // Extensions using the hook might still return an empty $messageName
-               if( $messageName ) {
+               if ( $messageName ) {
                        $this->getOutput()->wrapWikiMsg( "<p class=\"mw-search-createlink\">\n$1</p>", $params );
                } else {
                        // preserve the paragraph for margins etc...
@@ -464,9 +466,9 @@ class SpecialSearch extends SpecialPage {
         */
        protected function setupPage( $term ) {
                # Should advanced UI be used?
-               $this->searchAdvanced = ($this->profile === 'advanced');
+               $this->searchAdvanced = ( $this->profile === 'advanced' );
                $out = $this->getOutput();
-               if( strval( $term ) !== '' ) {
+               if ( strval( $term ) !== '' ) {
                        $out->setPageTitle( $this->msg( 'searchresults' ) );
                        $out->setHTMLTitle( $this->msg( 'pagetitle' )->rawParams(
                                $this->msg( 'searchresults-title' )->rawParams( $term )->text()
@@ -485,8 +487,8 @@ class SpecialSearch extends SpecialPage {
         */
        protected function powerSearch( &$request ) {
                $arr = array();
-               foreach( SearchEngine::searchableNamespaces() as $ns => $name ) {
-                       if( $request->getCheck( 'ns' . $ns ) ) {
+               foreach ( SearchEngine::searchableNamespaces() as $ns => $name ) {
+                       if ( $request->getCheck( 'ns' . $ns ) ) {
                                $arr[] = $ns;
                        }
                }
@@ -502,10 +504,10 @@ class SpecialSearch extends SpecialPage {
        protected function powerSearchOptions() {
                $opt = array();
                $opt['redirs'] = $this->searchRedirects ? 1 : 0;
-               if( $this->profile !== 'advanced' ) {
+               if ( $this->profile !== 'advanced' ) {
                        $opt['profile'] = $this->profile;
                } else {
-                       foreach( $this->namespaces as $n ) {
+                       foreach ( $this->namespaces as $n ) {
                                $opt['ns' . $n] = 1;
                        }
                }
@@ -527,12 +529,12 @@ 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";
                $result = $matches->next();
-               while( $result ) {
+               while ( $result ) {
                        $out .= $this->showHit( $result, $terms );
                        $result = $matches->next();
                }
@@ -555,7 +557,7 @@ class SpecialSearch extends SpecialPage {
        protected function showHit( $result, $terms ) {
                wfProfileIn( __METHOD__ );
 
-               if( $result->isBrokenTitle() ) {
+               if ( $result->isBrokenTitle() ) {
                        wfProfileOut( __METHOD__ );
                        return "<!-- Broken link in search result -->\n";
                }
@@ -564,8 +566,9 @@ class SpecialSearch extends SpecialPage {
 
                $titleSnippet = $result->getTitleSnippet( $terms );
 
-               if( $titleSnippet == '' )
+               if ( $titleSnippet == '' ) {
                        $titleSnippet = null;
+               }
 
                $link_t = clone $t;
 
@@ -580,7 +583,7 @@ class SpecialSearch extends SpecialPage {
                //If page content is not readable, just return the title.
                //This is not quite safe, but better than showing excerpts from non-readable pages
                //Note that hiding the entry entirely would screw up paging.
-               if( !$t->userCan( 'read', $this->getUser() ) ) {
+               if ( !$t->userCan( 'read', $this->getUser() ) ) {
                        wfProfileOut( __METHOD__ );
                        return "<li>{$link}</li>\n";
                }
@@ -588,7 +591,7 @@ class SpecialSearch extends SpecialPage {
                // If the page doesn't *exist*... our search index is out of date.
                // The least confusing at this point is to drop the result.
                // You may get less results, but... oh well. :P
-               if( $result->isMissingRevision() ) {
+               if ( $result->isMissingRevision() ) {
                        wfProfileOut( __METHOD__ );
                        return "<!-- missing page " . htmlspecialchars( $t->getPrefixedText() ) . "-->\n";
                }
@@ -600,9 +603,10 @@ class SpecialSearch extends SpecialPage {
                $sectionText = $result->getSectionSnippet( $terms );
                $redirect = '';
 
-               if( !is_null( $redirectTitle ) ) {
-                       if( $redirectText == '' )
+               if ( !is_null( $redirectTitle ) ) {
+                       if ( $redirectText == '' ) {
                                $redirectText = null;
+                       }
 
                        $redirect = "<span class='searchalttitle'>" .
                                $this->msg( 'search-redirect' )->rawParams(
@@ -612,9 +616,10 @@ class SpecialSearch extends SpecialPage {
 
                $section = '';
 
-               if( !is_null( $sectionTitle ) ) {
-                       if( $sectionText == '' )
+               if ( !is_null( $sectionTitle ) ) {
+                       if ( $sectionText == '' ) {
                                $sectionText = null;
+                       }
 
                        $section = "<span class='searchalttitle'>" .
                                $this->msg( 'search-section' )->rawParams(
@@ -628,7 +633,7 @@ class SpecialSearch extends SpecialPage {
                $lang = $this->getLanguage();
 
                // format score
-               if( is_null( $result->getScore() ) ) {
+               if ( is_null( $result->getScore() ) ) {
                        // Search engine doesn't report scoring info
                        $score = '';
                } else {
@@ -644,7 +649,7 @@ class SpecialSearch extends SpecialPage {
                $size = $this->msg( 'search-result-size', $lang->formatSize( $byteSize ) )
                        ->numParams( $wordCount )->escaped();
 
-               if( $t->getNamespace() == NS_CATEGORY ) {
+               if ( $t->getNamespace() == NS_CATEGORY ) {
                        $cat = Category::newFromTitle( $t );
                        $size = $this->msg( 'search-result-category-size' )
                                ->numParams( $cat->getPageCount(), $cat->getSubcatCount(), $cat->getFileCount() )
@@ -655,7 +660,7 @@ class SpecialSearch extends SpecialPage {
 
                // link to related articles if supported
                $related = '';
-               if( $result->hasRelated() ) {
+               if ( $result->hasRelated() ) {
                        $st = SpecialPage::getTitleFor( 'Search' );
                        $stParams = array_merge(
                                $this->powerSearchOptions(),
@@ -675,11 +680,11 @@ class SpecialSearch extends SpecialPage {
                }
 
                // Include a thumbnail for media files...
-               if( $t->getNamespace() == NS_FILE ) {
+               if ( $t->getNamespace() == NS_FILE ) {
                        $img = wfFindFile( $t );
-                       if( $img ) {
+                       if ( $img ) {
                                $thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) );
-                               if( $thumb ) {
+                               if ( $thumb ) {
                                        $desc = $this->msg( 'parentheses' )->rawParams( $img->getShortDesc() )->escaped();
                                        wfProfileOut( __METHOD__ );
                                        // Float doesn't seem to interact well with the bullets.
@@ -740,16 +745,16 @@ 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 ) {
+               foreach ( $customLines as $line ) {
                        $parts = explode( ":", $line, 2 );
-                       if( count( $parts ) == 2 ) { // validate line
+                       if ( count( $parts ) == 2 ) { // validate line
                                $customCaptions[$parts[0]] = $parts[1];
                        }
                }
 
                $prev = null;
                $result = $matches->next();
-               while( $result ) {
+               while ( $result ) {
                        $out .= $this->showInterwikiHit( $result, $prev, $terms, $query, $customCaptions );
                        $prev = $result->getInterwikiPrefix();
                        $result = $matches->next();
@@ -774,10 +779,10 @@ class SpecialSearch extends SpecialPage {
         *
         * @return string
         */
-       protected function showInterwikiHit( $result, $lastInterwiki, $terms, $query, $customCaptions) {
+       protected function showInterwikiHit( $result, $lastInterwiki, $terms, $query, $customCaptions ) {
                wfProfileIn( __METHOD__ );
 
-               if( $result->isBrokenTitle() ) {
+               if ( $result->isBrokenTitle() ) {
                        wfProfileOut( __METHOD__ );
                        return "<!-- Broken link in search result -->\n";
                }
@@ -786,8 +791,9 @@ class SpecialSearch extends SpecialPage {
 
                $titleSnippet = $result->getTitleSnippet( $terms );
 
-               if( $titleSnippet == '' )
+               if ( $titleSnippet == '' ) {
                        $titleSnippet = null;
+               }
 
                $link = Linker::linkKnown(
                        $t,
@@ -798,9 +804,10 @@ class SpecialSearch extends SpecialPage {
                $redirectTitle = $result->getRedirectTitle();
                $redirectText = $result->getRedirectSnippet( $terms );
                $redirect = '';
-               if( !is_null( $redirectTitle ) ) {
-                       if( $redirectText == '' )
+               if ( !is_null( $redirectTitle ) ) {
+                       if ( $redirectText == '' ) {
                                $redirectText = null;
+                       }
 
                        $redirect = "<span class='searchalttitle'>" .
                                $this->msg( 'search-redirect' )->rawParams(
@@ -810,8 +817,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 {
@@ -870,13 +877,13 @@ class SpecialSearch extends SpecialPage {
        protected function powerSearchBox( $term, $opts ) {
                // Groups namespaces into rows according to subject
                $rows = array();
-               foreach( SearchEngine::searchableNamespaces() as $namespace => $name ) {
+               foreach ( SearchEngine::searchableNamespaces() as $namespace => $name ) {
                        $subject = MWNamespace::getSubject( $namespace );
-                       if( !array_key_exists( $subject, $rows ) ) {
+                       if ( !array_key_exists( $subject, $rows ) ) {
                                $rows[$subject] = "";
                        }
                        $name = str_replace( '_', ' ', $name );
-                       if( $name == '' ) {
+                       if ( $name == '' ) {
                                $name = $this->msg( 'blanknamespace' )->text();
                        }
                        $rows[$subject] .=
@@ -897,12 +904,12 @@ class SpecialSearch extends SpecialPage {
                // Lays out namespaces in multiple floating two-column tables so they'll
                // be arranged nicely while still accommodating different screen widths
                $namespaceTables = '';
-               for( $i = 0; $i < $numRows; $i += 4 ) {
+               for ( $i = 0; $i < $numRows; $i += 4 ) {
                        $namespaceTables .= Xml::openElement(
                                'table',
                                array( 'cellpadding' => 0, 'cellspacing' => 0 )
                        );
-                       for( $j = $i; $j < $i + 4 && $j < $numRows; $j++ ) {
+                       for ( $j = $i; $j < $i + 4 && $j < $numRows; $j++ ) {
                                $namespaceTables .= Xml::tags( 'tr', null, $rows[$j] );
                        }
                        $namespaceTables .= Xml::closeElement( 'table' );
@@ -911,7 +918,7 @@ class SpecialSearch extends SpecialPage {
                $showSections = array( 'namespaceTables' => $namespaceTables );
 
                // Show redirects check only if backend supports it
-               if( $this->getSearchEngine()->supports( 'list-redirects' ) ) {
+               if ( $this->getSearchEngine()->supports( 'list-redirects' ) ) {
                        $showSections['redirects'] =
                                Xml::checkLabel( $this->msg( 'powersearch-redir' )->text(), 'redirs', 'redirs', $this->searchRedirects );
                }
@@ -920,7 +927,7 @@ class SpecialSearch extends SpecialPage {
 
                $hidden = '';
                unset( $opts['redirs'] );
-               foreach( $opts as $key => $value ) {
+               foreach ( $opts as $key => $value ) {
                        $hidden .= Html::hidden( $key, $value );
                }
                // Return final output
@@ -980,8 +987,10 @@ class SpecialSearch extends SpecialPage {
 
                wfRunHooks( 'SpecialSearchProfiles', array( &$profiles ) );
 
-               foreach( $profiles as &$data ) {
-                       if ( !is_array( $data['namespaces'] ) ) continue;
+               foreach ( $profiles as &$data ) {
+                       if ( !is_array( $data['namespaces'] ) ) {
+                               continue;
+                       }
                        sort( $data['namespaces'] );
                }
 
@@ -998,7 +1007,7 @@ class SpecialSearch extends SpecialPage {
                $out = Xml::openElement( 'div', array( 'class' => 'mw-search-formheader' ) );
 
                $bareterm = $term;
-               if( $this->startsWithImage( $term ) ) {
+               if ( $this->startsWithImage( $term ) ) {
                        // Deletes prefixes
                        $bareterm = substr( $term, strpos( $term, ':' ) + 1 );
                }
@@ -1092,7 +1101,7 @@ class SpecialSearch extends SpecialPage {
         */
        protected function makeSearchLink( $term, $namespaces, $label, $tooltip, $params = array() ) {
                $opt = $params;
-               foreach( $namespaces as $n ) {
+               foreach ( $namespaces as $n ) {
                        $opt['ns' . $n] = 1;
                }
                $opt['redirs'] = $this->searchRedirects;
@@ -1125,7 +1134,7 @@ class SpecialSearch extends SpecialPage {
                global $wgContLang;
 
                $p = explode( ':', $term );
-               if( count( $p ) > 1 ) {
+               if ( count( $p ) > 1 ) {
                        return $wgContLang->getNsIndex( $p[0] ) == NS_FILE;
                }
                return false;
@@ -1142,7 +1151,7 @@ class SpecialSearch extends SpecialPage {
                $allkeyword = $this->msg( 'searchall' )->inContentLanguage()->text();
 
                $p = explode( ':', $term );
-               if( count( $p ) > 1 ) {
+               if ( count( $p ) > 1 ) {
                        return $p[0] == $allkeyword;
                }
                return false;
index 3901074..47c89d0 100644 (file)
@@ -53,7 +53,7 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
 
                $pages = SpecialPageFactory::getUsablePages( $this->getUser() );
 
-               if( !count( $pages ) ) {
+               if ( !count( $pages ) ) {
                        # Yeah, that was pointless. Thanks for coming.
                        return false;
                }
@@ -64,7 +64,7 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                foreach ( $pages as $page ) {
                        if ( $page->isListed() ) {
                                $group = $page->getFinalGroupName();
-                               if( !isset( $groups[$group] ) ) {
+                               if ( !isset( $groups[$group] ) ) {
                                        $groups[$group] = array();
                                }
                                $groups[$group][$page->getDescription()] = array(
@@ -77,13 +77,13 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
 
                /** Sort */
                if ( $wgSortSpecialPages ) {
-                       foreach( $groups as $group => $sortedPages ) {
+                       foreach ( $groups as $group => $sortedPages ) {
                                ksort( $groups[$group] );
                        }
                }
 
                /** Always move "other" to end */
-               if( array_key_exists( 'other', $groups ) ) {
+               if ( array_key_exists( 'other', $groups ) ) {
                        $other = $groups['other'];
                        unset( $groups['other'] );
                        $groups['other'] = $other;
@@ -110,7 +110,7 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                                Html::openElement( 'td', array( 'style' => 'width:30%;vertical-align:top' ) ) . "\n" .
                                Html::openElement( 'ul' ) . "\n"
                        );
-                       foreach( $sortedPages as $desc => $specialpage ) {
+                       foreach ( $sortedPages as $desc => $specialpage ) {
                                list( $title, $restricted, $cached ) = $specialpage;
 
                                $pageClasses = array();
@@ -118,7 +118,7 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                                        $includesCachedPages = true;
                                        $pageClasses[] = 'mw-specialpagecached';
                                }
-                               if( $restricted ) {
+                               if ( $restricted ) {
                                        $includesRestrictedPages = true;
                                        $pageClasses[] = 'mw-specialpagerestricted';
                                }
@@ -128,7 +128,7 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
 
                                # Split up the larger groups
                                $count++;
-                               if( $total > 3 && $count == $middle ) {
+                               if ( $total > 3 && $count == $middle ) {
                                        $out->addHTML(
                                                Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) .
                                                Html::element( 'td', array( 'style' => 'width:10%' ), '' ) .
index a362fa2..2ec955e 100644 (file)
@@ -53,15 +53,15 @@ class SpecialStatistics extends SpecialPage {
 
                # Staticic - views
                $viewsStats = '';
-               if( !$wgDisableCounters ) {
+               if ( !$wgDisableCounters ) {
                        $viewsStats = $this->getViewsStats();
                }
 
                # Set active user count
-               if( !$wgMiserMode ) {
+               if ( !$wgMiserMode ) {
                        $key = wfMemcKey( 'sitestats', 'activeusers-updated' );
                        // Re-calculate the count if the last tally is old...
-                       if( !$wgMemc->get( $key ) ) {
+                       if ( !$wgMemc->get( $key ) ) {
                                $dbw = wfGetDB( DB_MASTER );
                                SiteStatsUpdate::cacheUpdate( $dbw );
                                $wgMemc->set( $key, '1', 24 * 3600 ); // don't update for 1 day
@@ -84,13 +84,13 @@ class SpecialStatistics extends SpecialPage {
                $text .= $viewsStats;
 
                # Statistic - popular pages
-               if( !$wgDisableCounters && !$wgMiserMode ) {
+               if ( !$wgDisableCounters && !$wgMiserMode ) {
                        $text .= $this->getMostViewedPages();
                }
 
                # Statistic - other
                $extraStats = array();
-               if( wfRunHooks( 'SpecialStatsAddExtra', array( &$extraStats ) ) ) {
+               if ( wfRunHooks( 'SpecialStatsAddExtra', array( &$extraStats ) ) ) {
                        $text .= $this->getOtherStats( $extraStats );
                }
 
@@ -115,11 +115,11 @@ class SpecialStatistics extends SpecialPage {
         * @return string table row in HTML format
         */
        private function formatRow( $text, $number, $trExtraParams = array(), $descMsg = '', $descMsgParam = '' ) {
-               if( $descMsg ) {
+               if ( $descMsg ) {
                        $msg = $this->msg( $descMsg, $descMsgParam );
                        if ( $msg->exists() ) {
                                $descriptionText = $this->msg( 'parentheses' )->rawParams( $msg->parse() )->escaped();
-                               $text .= "<br />" . Xml::element( 'small', array( 'class' => 'mw-statistic-desc'),
+                               $text .= "<br />" . Xml::element( 'small', array( 'class' => 'mw-statistic-desc' ),
                                        " $descriptionText" );
                        }
                }
@@ -181,7 +181,7 @@ class SpecialStatistics extends SpecialPage {
        private function getGroupStats() {
                global $wgGroupPermissions, $wgImplicitGroups;
                $text = '';
-               foreach( $wgGroupPermissions as $group => $permissions ) {
+               foreach ( $wgGroupPermissions as $group => $permissions ) {
                        # Skip generic * and implicit groups
                        if ( in_array( $group, $wgImplicitGroups ) || $group == '*' ) {
                                continue;
@@ -213,7 +213,7 @@ class SpecialStatistics extends SpecialPage {
                        # Add a class when a usergroup contains no members to allow hiding these rows
                        $classZero = '';
                        $countUsers = SiteStats::numberingroup( $groupname );
-                       if( $countUsers == 0 ) {
+                       if ( $countUsers == 0 ) {
                                $classZero = ' statistics-group-zero';
                        }
                        $text .= $this->formatRow( $grouppage . ' ' . $grouplink,
@@ -256,13 +256,13 @@ class SpecialStatistics extends SpecialPage {
                                        'LIMIT' => 10,
                                )
                        );
-                       if( $res->numRows() > 0 ) {
+                       if ( $res->numRows() > 0 ) {
                                $text .= Xml::openElement( 'tr' );
                                $text .= Xml::tags( 'th', array( 'colspan' => '2' ), $this->msg( 'statistics-mostpopular' )->parse() );
                                $text .= Xml::closeElement( 'tr' );
                                foreach ( $res as $row ) {
                                        $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
-                                       if( $title instanceof Title ) {
+                                       if ( $title instanceof Title ) {
                                                $text .= $this->formatRow( Linker::link( $title ),
                                                                $this->getLanguage()->formatNum( $row->page_counter ) );
 
@@ -283,8 +283,7 @@ class SpecialStatistics extends SpecialPage {
        private function getOtherStats( array $stats ) {
                $return = '';
 
-               foreach( $stats as $header => $items ) {
-
+               foreach ( $stats as $header => $items ) {
                        // Identify the structure used
                        if ( is_array( $items ) ) {
 
@@ -294,7 +293,7 @@ class SpecialStatistics extends SpecialPage {
                                }
 
                                // Collect all items that belong to the same header
-                               foreach( $items as $key => $value ) {
+                               foreach ( $items as $key => $value ) {
                                        $name = $this->msg( $key )->inContentLanguage()->parse();
                                        $number = htmlspecialchars( $value );
 
index 026b936..d87f263 100644 (file)
@@ -54,7 +54,7 @@ class SpecialTags extends SpecialPage {
                        $html .= $this->doTagRow( $row->ct_tag, $row->hitcount );
                }
 
-               foreach( ChangeTags::listDefinedTags() as $tag ) {
+               foreach ( ChangeTags::listDefinedTags() as $tag ) {
                        $html .= $this->doTagRow( $tag, 0 );
                }
 
index 7b3ae6b..b2b2946 100644 (file)
@@ -56,7 +56,7 @@ class SpecialUnblock extends SpecialPage {
                $form->setSubmitTextMsg( 'ipusubmit' );
                $form->addPreText( $this->msg( 'unblockiptext' )->parseAsBlock() );
 
-               if( $form->show() ) {
+               if ( $form->show() ) {
                        switch( $this->type ) {
                                case Block::TYPE_USER:
                                case Block::TYPE_IP:
@@ -92,14 +92,14 @@ 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'] );
 
@@ -159,7 +159,7 @@ class SpecialUnblock extends SpecialPage {
                $target = $data['Target'];
                $block = Block::newFromTarget( $data['Target'] );
 
-               if( !$block instanceof Block ) {
+               if ( !$block instanceof Block ) {
                        return array( array( 'ipb_cant_unblock', $target ) );
                }
 
@@ -174,14 +174,14 @@ class SpecialUnblock extends SpecialPage {
                # If the specified IP is a single address, and the block is a range block, don't
                # unblock the whole range.
                list( $target, $type ) = SpecialBlock::getTargetAndType( $target );
-               if( $block->getType() == Block::TYPE_RANGE && $type == Block::TYPE_IP ) {
+               if ( $block->getType() == Block::TYPE_RANGE && $type == Block::TYPE_IP ) {
                        $range = $block->getTarget();
                        return array( array( 'ipb_blocked_as_range', $target, $range ) );
                }
 
                # If the name was hidden and the blocking user cannot hide
                # names, then don't allow any block removals...
-               if( !$performer->isAllowed( 'hideuser' ) && $block->mHideName ) {
+               if ( !$performer->isAllowed( 'hideuser' ) && $block->mHideName ) {
                        return array( 'unblock-hideuser' );
                }
 
@@ -191,7 +191,7 @@ class SpecialUnblock extends SpecialPage {
                }
 
                # Unset _deleted fields as needed
-               if( $block->mHideName ) {
+               if ( $block->mHideName ) {
                        # Something is deeply FUBAR if this is not a User object, but who knows?
                        $id = $block->getTarget() instanceof User
                                ? $block->getTarget()->getID()
index bfcb58f..8bc9e48 100644 (file)
@@ -65,8 +65,9 @@ class UncategorizedPagesPage extends PageQueryPage {
        function getOrderFields() {
                // For some crazy reason ordering by a constant
                // causes a filesort
-               if( $this->requestedNamespace === false && count( MWNamespace::getContentNamespaces() ) > 1 )
+               if ( $this->requestedNamespace === false && count( MWNamespace::getContentNamespaces() ) > 1 ) {
                        return array( 'page_namespace', 'page_title' );
+               }
                return array( 'page_title' );
        }
 
index b665c4b..6fb133a 100644 (file)
@@ -90,7 +90,7 @@ class SpecialUpload extends SpecialPage {
 
                // Guess the desired name from the filename if not provided
                $this->mDesiredDestName = $request->getText( 'wpDestFile' );
-               if( !$this->mDesiredDestName && $request->getFileName( 'wpUploadFile' ) !== null ) {
+               if ( !$this->mDesiredDestName && $request->getFileName( 'wpUploadFile' ) !== null ) {
                        $this->mDesiredDestName = $request->getFileName( 'wpUploadFile' );
                }
                $this->mComment = $request->getText( 'wpUploadDescription' );
@@ -135,19 +135,19 @@ class SpecialUpload extends SpecialPage {
                $this->outputHeader();
 
                # Check uploading enabled
-               if( !UploadBase::isEnabled() ) {
+               if ( !UploadBase::isEnabled() ) {
                        throw new ErrorPageError( 'uploaddisabled', 'uploaddisabledtext' );
                }
 
                # Check permissions
                $user = $this->getUser();
                $permissionRequired = UploadBase::isAllowed( $user );
-               if( $permissionRequired !== true ) {
+               if ( $permissionRequired !== true ) {
                        throw new PermissionsError( $permissionRequired );
                }
 
                # Check blocks
-               if( $user->isBlocked() ) {
+               if ( $user->isBlocked() ) {
                        throw new UserBlockedError( $user->getBlock() );
                }
 
@@ -172,7 +172,7 @@ class SpecialUpload extends SpecialPage {
                        $this->processUpload();
                } else {
                        # Backwards compatibility hook
-                       if( !wfRunHooks( 'UploadForm:initial', array( &$this ) ) ) {
+                       if ( !wfRunHooks( 'UploadForm:initial', array( &$this ) ) ) {
                                wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" );
                                return;
                        }
@@ -229,7 +229,7 @@ class SpecialUpload extends SpecialPage {
                $form->setTitle( $this->getTitle() );
 
                # Check the token, but only if necessary
-               if(
+               if (
                        !$this->mTokenOk && !$this->mCancelUpload &&
                        ( $this->mUpload && $this->mUploadClicked )
                ) {
@@ -275,7 +275,7 @@ class SpecialUpload extends SpecialPage {
                $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
                $user = $this->getUser();
                // Show a subtitle link to deleted revisions (to sysops et al only)
-               if( $title instanceof Title ) {
+               if ( $title instanceof Title ) {
                        $count = $title->isDeleted();
                        if ( $count > 0 && $user->isAllowed( 'deletedhistory' ) ) {
                                $restorelink = Linker::linkKnown(
@@ -333,15 +333,15 @@ class SpecialUpload extends SpecialPage {
 
                $warningHtml = '<h2>' . $this->msg( 'uploadwarning' )->escaped() . "</h2>\n"
                        . '<ul class="warning">';
-               foreach( $warnings as $warning => $args ) {
-                       if( $warning == 'badfilename' ) {
+               foreach ( $warnings as $warning => $args ) {
+                       if ( $warning == 'badfilename' ) {
                                $this->mDesiredDestName = Title::makeTitle( NS_FILE, $args )->getText();
                        }
-                       if( $warning == 'exists' ) {
+                       if ( $warning == 'exists' ) {
                                $msg = "\t<li>" . self::getExistsWarning( $args ) . "</li>\n";
-                       } elseif( $warning == 'duplicate' ) {
+                       } elseif ( $warning == 'duplicate' ) {
                                $msg = self::getDupeWarning( $args );
-                       } elseif( $warning == 'duplicate-archive' ) {
+                       } elseif ( $warning == 'duplicate-archive' ) {
                                $msg = "\t<li>" . $this->msg( 'file-deleted-duplicate',
                                                Title::makeTitle( NS_FILE, $args )->getPrefixedText() )->parse()
                                        . "</li>\n";
@@ -387,12 +387,12 @@ class SpecialUpload extends SpecialPage {
        protected function processUpload() {
                // Fetch the file if required
                $status = $this->mUpload->fetchFile();
-               if( !$status->isOK() ) {
+               if ( !$status->isOK() ) {
                        $this->showUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
                        return;
                }
 
-               if( !wfRunHooks( 'UploadForm:BeforeProcessing', array( &$this ) ) ) {
+               if ( !wfRunHooks( 'UploadForm:BeforeProcessing', array( &$this ) ) ) {
                        wfDebug( "Hook 'UploadForm:BeforeProcessing' broke processing the file.\n" );
                        // This code path is deprecated. If you want to break upload processing
                        // do so by hooking into the appropriate hooks in UploadBase::verifyUpload
@@ -411,7 +411,7 @@ class SpecialUpload extends SpecialPage {
 
                // Verify permissions for this title
                $permErrors = $this->mUpload->verifyTitlePermissions( $this->getUser() );
-               if( $permErrors !== true ) {
+               if ( $permErrors !== true ) {
                        $code = array_shift( $permErrors[0] );
                        $this->showRecoverableUploadError( $this->msg( $code, $permErrors[0] )->parse() );
                        return;
@@ -420,15 +420,15 @@ class SpecialUpload extends SpecialPage {
                $this->mLocalFile = $this->mUpload->getLocalFile();
 
                // Check warnings if necessary
-               if( !$this->mIgnoreWarning ) {
+               if ( !$this->mIgnoreWarning ) {
                        $warnings = $this->mUpload->checkWarnings();
-                       if( $this->showUploadWarning( $warnings ) ) {
+                       if ( $this->showUploadWarning( $warnings ) ) {
                                return;
                        }
                }
 
                // Get the page text if this is not a reupload
-               if( !$this->mForReUpload ) {
+               if ( !$this->mForReUpload ) {
                        $pageText = self::getInitialPageText( $this->mComment, $this->mLicense,
                                $this->mCopyrightStatus, $this->mCopyrightSource );
                } else {
@@ -463,7 +463,7 @@ class SpecialUpload extends SpecialPage {
                 * Thus, forcing them as content messages makes the upload to produce an int: template
                 * instead of hardcoding it there in the uploader language.
                 */
-               foreach( array( 'license-header', 'filedesc', 'filestatus', 'filesource' ) as $msgName ) {
+               foreach ( array( 'license-header', 'filedesc', 'filestatus', 'filesource' ) as $msgName ) {
                        if ( in_array( $msgName, $wgForceUIMsgAsContentMsg ) ) {
                                $msg[$msgName] = "{{int:$msgName}}";
                        } else {
@@ -505,13 +505,13 @@ class SpecialUpload extends SpecialPage {
         * @return Bool|String
         */
        protected function getWatchCheck() {
-               if( $this->getUser()->getOption( 'watchdefault' ) ) {
+               if ( $this->getUser()->getOption( 'watchdefault' ) ) {
                        // Watch all edits!
                        return true;
                }
 
                $local = wfLocalFile( $this->mDesiredDestName );
-               if( $local && $local->exists() ) {
+               if ( $local && $local->exists() ) {
                        // We're uploading a new version of an existing file.
                        // No creation, so don't watch it if we're not already.
                        return $this->getUser()->isWatched( $local->getTitle() );
@@ -635,10 +635,10 @@ class SpecialUpload extends SpecialPage {
                $filename = $file->getTitle()->getPrefixedText();
                $warning = '';
 
-               if( $exists['warning'] == 'exists' ) {
+               if ( $exists['warning'] == 'exists' ) {
                        // Exact match
                        $warning = wfMessage( 'fileexists', $filename )->parse();
-               } elseif( $exists['warning'] == 'page-exists' ) {
+               } elseif ( $exists['warning'] == 'page-exists' ) {
                        // Page exists but file does not
                        $warning = wfMessage( 'filepageexists', $filename )->parse();
                } elseif ( $exists['warning'] == 'exists-normalized' ) {
@@ -681,7 +681,7 @@ class SpecialUpload extends SpecialPage {
         */
        public static function ajaxGetExistsWarning( $filename ) {
                $file = wfFindFile( $filename );
-               if( !$file ) {
+               if ( !$file ) {
                        // Force local file so we have an object to do further checks against
                        // if there isn't an exact match...
                        $file = wfLocalFile( $filename );
@@ -709,7 +709,7 @@ class SpecialUpload extends SpecialPage {
 
                $gallery = new ImageGallery;
                $gallery->setShowBytes( false );
-               foreach( $dupes as $file ) {
+               foreach ( $dupes as $file ) {
                        $gallery->add( $file->getTitle() );
                }
                return '<li>' .
@@ -889,8 +889,8 @@ class UploadForm extends HTMLForm {
                global $wgCheckFileExtensions, $wgStrictFileExtensions,
                $wgFileExtensions, $wgFileBlacklist;
 
-               if( $wgCheckFileExtensions ) {
-                       if( $wgStrictFileExtensions ) {
+               if ( $wgCheckFileExtensions ) {
+                       if ( $wgStrictFileExtensions ) {
                                # Everything not permitted is banned
                                $extensionsList =
                                        '<div id="mw-upload-permitted">' .
index a8e140d..238d838 100644 (file)
@@ -222,7 +222,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                global $wgUploadStashScalerBaseUrl;
                $scalerBaseUrl = $wgUploadStashScalerBaseUrl;
 
-               if( preg_match( '/^\/\//', $scalerBaseUrl ) ) {
+               if ( preg_match( '/^\/\//', $scalerBaseUrl ) ) {
                        // this is apparently a protocol-relative URL, which makes no sense in this context,
                        // since this is used for communication that's internal to the application.
                        // default to http.
index c3a954f..f7e4d0a 100644 (file)
@@ -115,18 +115,18 @@ class LoginForm extends SpecialPage {
                $this->mReturnTo = $request->getVal( 'returnto', '' );
                $this->mReturnToQuery = $request->getVal( 'returntoquery', '' );
 
-               if( $wgEnableEmail ) {
+               if ( $wgEnableEmail ) {
                        $this->mEmail = $request->getText( 'wpEmail' );
                } else {
                        $this->mEmail = '';
                }
-               if( !in_array( 'realname', $wgHiddenPrefs ) ) {
+               if ( !in_array( 'realname', $wgHiddenPrefs ) ) {
                        $this->mRealName = $request->getText( 'wpRealName' );
                } else {
                        $this->mRealName = '';
                }
 
-               if( !$wgAuth->validDomain( $this->mDomain ) ) {
+               if ( !$wgAuth->validDomain( $this->mDomain ) ) {
                        $this->mDomain = $wgAuth->getDomain();
                }
                $wgAuth->setDomain( $this->mDomain );
@@ -135,7 +135,7 @@ class LoginForm extends SpecialPage {
                # 2. Do not return to PasswordReset after a successful password change
                #    but goto Wiki start page (Main_Page) instead ( bug 33997 )
                $returnToTitle = Title::newFromText( $this->mReturnTo );
-               if( is_object( $returnToTitle ) && (
+               if ( is_object( $returnToTitle ) && (
                        $returnToTitle->isSpecial( 'Userlogout' )
                        || $returnToTitle->isSpecial( 'PasswordReset' ) ) ) {
                        $this->mReturnTo = '';
@@ -206,8 +206,8 @@ class LoginForm extends SpecialPage {
                if ( !is_null( $this->mCookieCheck ) ) {
                        $this->onCookieRedirectCheck( $this->mCookieCheck );
                        return;
-               } elseif( $this->mPosted ) {
-                       if( $this->mCreateaccount ) {
+               } elseif ( $this->mPosted ) {
+                       if ( $this->mCreateaccount ) {
                                $this->addNewAccount();
                                return;
                        } elseif ( $this->mCreateaccountMail ) {
@@ -231,7 +231,7 @@ class LoginForm extends SpecialPage {
                }
 
                $status = $this->addNewaccountInternal();
-               if( !$status->isGood() ) {
+               if ( !$status->isGood() ) {
                        $error = $this->getOutput()->parse( $status->getWikiText() );
                        $this->mainLoginForm( $error );
                        return;
@@ -250,7 +250,7 @@ class LoginForm extends SpecialPage {
                $out = $this->getOutput();
                $out->setPageTitle( $this->msg( 'accmailtitle' ) );
 
-               if( !$result->isGood() ) {
+               if ( !$result->isGood() ) {
                        $this->mainLoginForm( $this->msg( 'mailerror', $result->getWikiText() )->text() );
                } else {
                        $out->addWikiMsg( 'accmailtext', $u->getName(), $u->getEmail() );
@@ -267,7 +267,7 @@ class LoginForm extends SpecialPage {
 
                # Create the account and abort if there's a problem doing so
                $status = $this->addNewAccountInternal();
-               if( !$status->isGood() ) {
+               if ( !$status->isGood() ) {
                        $error = $this->getOutput()->parse( $status->getWikiText() );
                        $this->mainLoginForm( $error );
                        return false;
@@ -279,7 +279,7 @@ class LoginForm extends SpecialPage {
                if ( $this->getUser()->isAnon() ) {
                        # If we showed up language selection links, and one was in use, be
                        # smart (and sensible) and save that language as the user's preference
-                       if( $wgLoginLanguageSelector && $this->mLanguage ) {
+                       if ( $wgLoginLanguageSelector && $this->mLanguage ) {
                                $u->setOption( 'language', $this->mLanguage );
                        } else {
 
@@ -296,9 +296,9 @@ class LoginForm extends SpecialPage {
                $out = $this->getOutput();
 
                # Send out an email authentication message if needed
-               if( $wgEmailAuthentication && Sanitizer::validateEmail( $u->getEmail() ) ) {
+               if ( $wgEmailAuthentication && Sanitizer::validateEmail( $u->getEmail() ) ) {
                        $status = $u->sendConfirmationMail();
-                       if( $status->isGood() ) {
+                       if ( $status->isGood() ) {
                                $out->addWikiMsg( 'confirmemail_oncreate' );
                        } else {
                                $out->addWikiText( $status->getWikiText( 'confirmemail_sendfailed' ) );
@@ -311,7 +311,7 @@ class LoginForm extends SpecialPage {
                # If not logged in, assume the new account as the current one and set
                # session cookies then show a "welcome" message or a "need cookies"
                # message as needed
-               if( $this->getUser()->isAnon() ) {
+               if ( $this->getUser()->isAnon() ) {
                        $u->setCookies();
                        $wgUser = $u;
                        // This should set it for OutputPage and the Skin
@@ -320,7 +320,7 @@ class LoginForm extends SpecialPage {
                        $this->getContext()->setUser( $u );
                        wfRunHooks( 'AddNewAccount', array( $u, false ) );
                        $u->addNewUserLogEntry( 'create' );
-                       if( $this->hasSessionCookie() ) {
+                       if ( $this->hasSessionCookie() ) {
                                $this->successfulCreation();
                        } else {
                                $this->cookieRedirectCheck( 'new' );
@@ -347,7 +347,7 @@ class LoginForm extends SpecialPage {
                        $wgMinimalPasswordLength, $wgEmailConfirmToEdit;
 
                // If the user passes an invalid domain, something is fishy
-               if( !$wgAuth->validDomain( $this->mDomain ) ) {
+               if ( !$wgAuth->validDomain( $this->mDomain ) ) {
                        return Status::newFatal( 'wrongpassword' );
                }
 
@@ -356,8 +356,8 @@ class LoginForm extends SpecialPage {
                // cation server before they create an account (otherwise, they can
                // create a local account and login as any domain user). We only need
                // to check this for domains that aren't local.
-               if( 'local' != $this->mDomain && $this->mDomain != '' ) {
-                       if(
+               if ( 'local' != $this->mDomain && $this->mDomain != '' ) {
+                       if (
                                !$wgAuth->canCreateAccounts() &&
                                (
                                        !$wgAuth->userExists( $this->mUsername ) ||
@@ -455,7 +455,7 @@ class LoginForm extends SpecialPage {
                $u->setRealName( $this->mRealName );
 
                $abortError = '';
-               if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) {
+               if ( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) {
                        // Hook point to add extra creation throttles and blocks
                        wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
                        return Status::newFatal( new RawMessage( $abortError ) );
@@ -478,7 +478,7 @@ class LoginForm extends SpecialPage {
                        }
                }
 
-               if( !$wgAuth->addUser( $u, $this->mPassword, $this->mEmail, $this->mRealName ) ) {
+               if ( !$wgAuth->addUser( $u, $this->mPassword, $this->mEmail, $this->mRealName ) ) {
                        return Status::newFatal( 'externaldberror' );
                }
 
@@ -576,7 +576,7 @@ class LoginForm extends SpecialPage {
                }
 
                $u = User::newFromName( $this->mUsername );
-               if( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) {
+               if ( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) {
                        return self::ILLEGAL;
                }
 
@@ -594,13 +594,13 @@ class LoginForm extends SpecialPage {
 
                // Give general extensions, such as a captcha, a chance to abort logins
                $abort = self::ABORTED;
-               if( !wfRunHooks( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$this->mAbortLoginErrorMsg ) ) ) {
+               if ( !wfRunHooks( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$this->mAbortLoginErrorMsg ) ) ) {
                        return $abort;
                }
 
                global $wgBlockDisablesLogin;
                if ( !$u->checkPassword( $this->mPassword ) ) {
-                       if( $u->checkTemporaryPassword( $this->mPassword ) ) {
+                       if ( $u->checkTemporaryPassword( $this->mPassword ) ) {
                                // The e-mailed temporary password should not be used for actu-
                                // al logins; that's a very sloppy habit, and insecure if an
                                // attacker has a few seconds to click "search" on someone's o-
@@ -617,7 +617,7 @@ class LoginForm extends SpecialPage {
                                // As a side-effect, we can authenticate the user's e-mail ad-
                                // dress if it's not already done, since the temporary password
                                // was sent via e-mail.
-                               if( !$u->isEmailConfirmed() ) {
+                               if ( !$u->isEmailConfirmed() ) {
                                        $u->confirmEmail();
                                        $u->saveSettings();
                                }
@@ -726,7 +726,7 @@ class LoginForm extends SpecialPage {
                }
 
                $abortError = '';
-               if( !wfRunHooks( 'AbortAutoAccount', array( $user, &$abortError ) ) ) {
+               if ( !wfRunHooks( 'AbortAutoAccount', array( $user, &$abortError ) ) ) {
                        // Hook point to add extra creation throttles and blocks
                        wfDebug( "LoginForm::attemptAutoCreate: a hook blocked creation: $abortError\n" );
                        $this->mAbortLoginErrorMsg = $abortError;
@@ -752,14 +752,14 @@ class LoginForm extends SpecialPage {
                        case self::SUCCESS:
                                # We've verified now, update the real record
                                $user = $this->getUser();
-                               if( (bool)$this->mRemember != $user->getBoolOption( 'rememberpassword' ) ) {
+                               if ( (bool)$this->mRemember != $user->getBoolOption( 'rememberpassword' ) ) {
                                        $user->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 );
                                        $user->saveSettings();
                                } else {
                                        $user->invalidateCache();
                                }
 
-                               if( $wgSecureLogin && !$this->mStickHTTPS ) {
+                               if ( $wgSecureLogin && !$this->mStickHTTPS ) {
                                        $user->setCookies( null, false );
                                } else {
                                        $user->setCookies();
@@ -771,7 +771,7 @@ class LoginForm extends SpecialPage {
                                $key = wfMemcKey( 'password-throttle', $request->getIP(), md5( $this->mUsername ) );
                                $wgMemc->delete( $key );
 
-                               if( $this->hasSessionCookie() || $this->mSkipCookieCheck ) {
+                               if ( $this->hasSessionCookie() || $this->mSkipCookieCheck ) {
                                        /* Replace the language object to provide user interface in
                                         * correct language immediately on this first page load.
                                         */
@@ -801,7 +801,7 @@ class LoginForm extends SpecialPage {
                                $this->mainLoginForm( $this->msg( 'wrongpassword' )->text() );
                                break;
                        case self::NOT_EXISTS:
-                               if( $this->getUser()->isAllowed( 'createaccount' ) ) {
+                               if ( $this->getUser()->isAllowed( 'createaccount' ) ) {
                                        $this->mainLoginForm( $this->msg( 'nosuchuser',
                                                wfEscapeWikiText( $this->mUsername ) )->parse() );
                                } else {
@@ -860,7 +860,7 @@ class LoginForm extends SpecialPage {
                        return Status::newFatal( 'noemail', $u->getName() );
                }
                $ip = $this->getRequest()->getIP();
-               if( !$ip ) {
+               if ( !$ip ) {
                        return Status::newFatal( 'badipaddress' );
                }
 
@@ -894,7 +894,7 @@ class LoginForm extends SpecialPage {
                $injected_html = '';
                wfRunHooks( 'UserLoginComplete', array( &$currentUser, &$injected_html ) );
 
-               if( $injected_html !== '' ) {
+               if ( $injected_html !== '' ) {
                        $this->displaySuccessfulAction( $this->msg( 'loginsuccesstitle' ),
                                'loginsuccess', $injected_html );
                } else {
@@ -1000,7 +1000,7 @@ class LoginForm extends SpecialPage {
                if ( $wgSecureLogin && !$this->mStickHTTPS ) {
                        $options = array( 'http' );
                        $proto = PROTO_HTTP;
-               } elseif( $wgSecureLogin ) {
+               } elseif ( $wgSecureLogin ) {
                        $options = array( 'https' );
                        $proto = PROTO_HTTPS;
                } else {
@@ -1101,9 +1101,9 @@ class LoginForm extends SpecialPage {
                }
 
                # Don't show a "create account" link if the user can't.
-               if( $this->showCreateOrLoginLink( $user ) ) {
+               if ( $this->showCreateOrLoginLink( $user ) ) {
                        # Pass any language selection on to the mode switch link
-                       if( $wgLoginLanguageSelector && $this->mLanguage ) {
+                       if ( $wgLoginLanguageSelector && $this->mLanguage ) {
                                $linkq .= '&uselang=' . $this->mLanguage;
                        }
                        if ( !$this->mShowVForm ) {
@@ -1170,9 +1170,9 @@ class LoginForm extends SpecialPage {
                }
 
                # Prepare language selection links as needed
-               if( $wgLoginLanguageSelector ) {
+               if ( $wgLoginLanguageSelector ) {
                        $template->set( 'languages', $this->makeLanguageSelector() );
-                       if( $this->mLanguage ) {
+                       if ( $this->mLanguage ) {
                                $template->set( 'uselang', $this->mLanguage );
                        }
                }
@@ -1214,9 +1214,9 @@ class LoginForm extends SpecialPage {
         * @return Boolean
         */
        function showCreateOrLoginLink( &$user ) {
-               if( $this->mType == 'signup' ) {
+               if ( $this->mType == 'signup' ) {
                        return true;
-               } elseif( $user->isAllowed( 'createaccount' ) ) {
+               } elseif ( $user->isAllowed( 'createaccount' ) ) {
                        return true;
                } else {
                        return false;
@@ -1295,7 +1295,7 @@ class LoginForm extends SpecialPage {
         */
        private function renewSessionId() {
                global $wgSecureLogin, $wgCookieSecure;
-               if( $wgSecureLogin && !$this->mStickHTTPS ) {
+               if ( $wgSecureLogin && !$this->mStickHTTPS ) {
                        $wgCookieSecure = false;
                }
 
@@ -1354,10 +1354,10 @@ class LoginForm extends SpecialPage {
         */
        function makeLanguageSelector() {
                $msg = $this->msg( 'loginlanguagelinks' )->inContentLanguage();
-               if( !$msg->isBlank() ) {
+               if ( !$msg->isBlank() ) {
                        $langs = explode( "\n", $msg->text() );
                        $links = array();
-                       foreach( $langs as $lang ) {
+                       foreach ( $langs as $lang ) {
                                $lang = trim( $lang, '* ' );
                                $parts = explode( '|', $lang );
                                if ( count( $parts ) >= 2 ) {
@@ -1380,15 +1380,15 @@ class LoginForm extends SpecialPage {
         * @return string
         */
        function makeLanguageSelectorLink( $text, $lang ) {
-               if( $this->getLanguage()->getCode() == $lang ) {
+               if ( $this->getLanguage()->getCode() == $lang ) {
                        // no link for currently used language
                        return htmlspecialchars( $text );
                }
                $query = array( 'uselang' => $lang );
-               if( $this->mType == 'signup' ) {
+               if ( $this->mType == 'signup' ) {
                        $query['type'] = 'signup';
                }
-               if( $this->mReturnTo !== '' ) {
+               if ( $this->mReturnTo !== '' ) {
                        $query['returnto'] = $this->mReturnTo;
                        $query['returntoquery'] = $this->mReturnToQuery;
                }
index 7501371..b9d6d30 100644 (file)
@@ -80,13 +80,13 @@ class UserrightsPage extends SpecialPage {
                 * (e.g. they don't have the userrights permission), then don't
                 * allow them to use Special:UserRights.
                 */
-               if( $user->isBlocked() && !$user->isAllowed( 'userrights' ) ) {
+               if ( $user->isBlocked() && !$user->isAllowed( 'userrights' ) ) {
                        throw new UserBlockedError( $user->getBlock() );
                }
 
                $request = $this->getRequest();
 
-               if( $par !== null ) {
+               if ( $par !== null ) {
                        $this->mTarget = $par;
                } else {
                        $this->mTarget = $request->getVal( 'user' );
@@ -100,15 +100,16 @@ class UserrightsPage extends SpecialPage {
                         * edit their own groups, automatically set them as the
                         * target.
                         */
-                       if ( !count( $available['add'] ) && !count( $available['remove'] ) )
+                       if ( !count( $available['add'] ) && !count( $available['remove'] ) ) {
                                $this->mTarget = $user->getName();
+                       }
                }
 
                if ( User::getCanonicalName( $this->mTarget ) == $user->getName() ) {
                        $this->isself = true;
                }
 
-               if( !$this->userCanChangeRights( $user, true ) ) {
+               if ( !$this->userCanChangeRights( $user, true ) ) {
                        // @todo FIXME: There may be intermediate groups we can mention.
                        $msg = $user->isAnon() ? 'userrights-nologin' : 'userrights-notallowed';
                        throw new PermissionsError( null, array( array( $msg ) ) );
@@ -127,12 +128,12 @@ class UserrightsPage extends SpecialPage {
                        $this->switchForm();
                }
 
-               if( $request->wasPosted() ) {
+               if ( $request->wasPosted() ) {
                        // save settings
-                       if( $request->getCheck( 'saveusergroups' ) ) {
+                       if ( $request->getCheck( 'saveusergroups' ) ) {
                                $reason = $request->getVal( 'user-reason' );
                                $tok = $request->getVal( 'wpEditToken' );
-                               if( $user->matchEditToken( $tok, $this->mTarget ) ) {
+                               if ( $user->matchEditToken( $tok, $this->mTarget ) ) {
                                        $this->saveUserGroups(
                                                $this->mTarget,
                                                $reason
@@ -145,7 +146,7 @@ class UserrightsPage extends SpecialPage {
                }
 
                // show some more forms
-               if( $this->mTarget !== null ) {
+               if ( $this->mTarget !== null ) {
                        $this->editUserGroupsForm( $this->mTarget );
                }
        }
@@ -164,7 +165,7 @@ class UserrightsPage extends SpecialPage {
         */
        function saveUserGroups( $username, $reason = '' ) {
                $status = $this->fetchUser( $username );
-               if( !$status->isOK() ) {
+               if ( !$status->isOK() ) {
                        $this->getOutput()->addWikiText( $status->getWikiText() );
                        return;
                } else {
@@ -218,15 +219,15 @@ class UserrightsPage extends SpecialPage {
                $newGroups = $oldGroups;
 
                // remove then add groups
-               if( $remove ) {
+               if ( $remove ) {
                        $newGroups = array_diff( $newGroups, $remove );
-                       foreach( $remove as $group ) {
+                       foreach ( $remove as $group ) {
                                $user->removeGroup( $group );
                        }
                }
-               if( $add ) {
+               if ( $add ) {
                        $newGroups = array_merge( $newGroups, $add );
-                       foreach( $add as $group ) {
+                       foreach ( $add as $group ) {
                                $user->addGroup( $group );
                        }
                }
@@ -239,7 +240,7 @@ class UserrightsPage extends SpecialPage {
                wfDebug( 'newGroups: ' . print_r( $newGroups, true ) );
                wfRunHooks( 'UserRights', array( &$user, $add, $remove ) );
 
-               if( $newGroups != $oldGroups ) {
+               if ( $newGroups != $oldGroups ) {
                        $this->addLogEntry( $user, $oldGroups, $newGroups, $reason );
                }
                return array( $add, $remove );
@@ -267,7 +268,7 @@ class UserrightsPage extends SpecialPage {
         */
        function editUserGroupsForm( $username ) {
                $status = $this->fetchUser( $username );
-               if( !$status->isOK() ) {
+               if ( !$status->isOK() ) {
                        $this->getOutput()->addWikiText( $status->getWikiText() );
                        return;
                } else {
@@ -295,57 +296,57 @@ class UserrightsPage extends SpecialPage {
                global $wgUserrightsInterwikiDelimiter;
 
                $parts = explode( $wgUserrightsInterwikiDelimiter, $username );
-               if( count( $parts ) < 2 ) {
+               if ( count( $parts ) < 2 ) {
                        $name = trim( $username );
                        $database = '';
                } else {
                        list( $name, $database ) = array_map( 'trim', $parts );
 
-                       if( $database == wfWikiID() ) {
+                       if ( $database == wfWikiID() ) {
                                $database = '';
                        } else {
-                               if( !$this->getUser()->isAllowed( 'userrights-interwiki' ) ) {
+                               if ( !$this->getUser()->isAllowed( 'userrights-interwiki' ) ) {
                                        return Status::newFatal( 'userrights-no-interwiki' );
                                }
-                               if( !UserRightsProxy::validDatabase( $database ) ) {
+                               if ( !UserRightsProxy::validDatabase( $database ) ) {
                                        return Status::newFatal( 'userrights-nodatabase', $database );
                                }
                        }
                }
 
-               if( $name === '' ) {
+               if ( $name === '' ) {
                        return Status::newFatal( 'nouserspecified' );
                }
 
-               if( $name[0] == '#' ) {
+               if ( $name[0] == '#' ) {
                        // Numeric ID can be specified...
                        // We'll do a lookup for the name internally.
                        $id = intval( substr( $name, 1 ) );
 
-                       if( $database == '' ) {
+                       if ( $database == '' ) {
                                $name = User::whoIs( $id );
                        } else {
                                $name = UserRightsProxy::whoIs( $database, $id );
                        }
 
-                       if( !$name ) {
+                       if ( !$name ) {
                                return Status::newFatal( 'noname' );
                        }
                } else {
                        $name = User::getCanonicalName( $name );
-                       if( $name === false ) {
+                       if ( $name === false ) {
                                // invalid name
                                return Status::newFatal( 'nosuchusershort', $username );
                        }
                }
 
-               if( $database == '' ) {
+               if ( $database == '' ) {
                        $user = User::newFromName( $name );
                } else {
                        $user = UserRightsProxy::newFromName( $database, $name );
                }
 
-               if( !$user || $user->isAnon() ) {
+               if ( !$user || $user->isAnon() ) {
                        return Status::newFatal( 'nosuchusershort', $username );
                }
 
@@ -353,7 +354,7 @@ class UserrightsPage extends SpecialPage {
        }
 
        function makeGroupNameList( $ids ) {
-               if( empty( $ids ) ) {
+               if ( empty( $ids ) ) {
                        return $this->msg( 'rightsnone' )->inContentLanguage()->text();
                } else {
                        return implode( ', ', $ids );
@@ -370,7 +371,7 @@ class UserrightsPage extends SpecialPage {
        function makeGroupNameListForLog( $ids ) {
                wfDeprecated( __METHOD__, '1.21' );
 
-               if( empty( $ids ) ) {
+               if ( empty( $ids ) ) {
                        return '';
                } else {
                        return $this->makeGroupNameList( $ids );
@@ -425,7 +426,7 @@ class UserrightsPage extends SpecialPage {
        protected function showEditUserGroupsForm( $user, $groups ) {
                $list = array();
                $membersList = array();
-               foreach( $groups as $group ) {
+               foreach ( $groups as $group ) {
                        $list[] = self::buildGroupLink( $group );
                        $membersList[] = self::buildGroupMemberLink( $group );
                }
@@ -433,7 +434,7 @@ class UserrightsPage extends SpecialPage {
                $autoList = array();
                $autoMembersList = array();
                if ( $user instanceof User ) {
-                       foreach( Autopromote::getAutopromoteGroups( $user ) as $group ) {
+                       foreach ( Autopromote::getAutopromoteGroups( $user ) as $group ) {
                                $autoList[] = self::buildGroupLink( $group );
                                $autoMembersList[] = self::buildGroupMemberLink( $group );
                        }
@@ -545,7 +546,7 @@ class UserrightsPage extends SpecialPage {
                # more easily manage it.
                $columns = array( 'unchangeable' => array(), 'changeable' => array() );
 
-               foreach( $allgroups as $group ) {
+               foreach ( $allgroups as $group ) {
                        $set = in_array( $group, $usergroups );
                        # Should the checkbox be disabled?
                        $disabled = !(
@@ -562,7 +563,7 @@ class UserrightsPage extends SpecialPage {
                                'irreversible' => $irreversible
                        );
 
-                       if( $disabled ) {
+                       if ( $disabled ) {
                                $columns['unchangeable'][$group] = $checkbox;
                        } else {
                                $columns['changeable'][$group] = $checkbox;
@@ -572,17 +573,19 @@ class UserrightsPage extends SpecialPage {
                # Build the HTML table
                $ret .= Xml::openElement( 'table', array( 'class' => 'mw-userrights-groups' ) ) .
                        "<tr>\n";
-               foreach( $columns as $name => $column ) {
-                       if( $column === array() )
+               foreach ( $columns as $name => $column ) {
+                       if ( $column === array() ) {
                                continue;
+                       }
                        $ret .= Xml::element( 'th', null, $this->msg( 'userrights-' . $name . '-col', count( $column ) )->text() );
                }
                $ret .= "</tr>\n<tr>\n";
-               foreach( $columns as $column ) {
-                       if( $column === array() )
+               foreach ( $columns as $column ) {
+                       if ( $column === array() ) {
                                continue;
+                       }
                        $ret .= "\t<td style='vertical-align:top;'>\n";
-                       foreach( $column as $group => $checkbox ) {
+                       foreach ( $column as $group => $checkbox ) {
                                $attr = $checkbox['disabled'] ? array( 'disabled' => 'disabled' ) : array();
 
                                $member = User::getGroupMember( $group, $user->getName() );
index d375316..b01058a 100644 (file)
@@ -55,7 +55,7 @@ class SpecialVersion extends SpecialPage {
                $out = $this->getOutput();
                $out->allowClickjacking();
 
-               if( $par !== 'Credits' ) {
+               if ( $par !== 'Credits' ) {
                        $text =
                                $this->getMediaWikiCredits() .
                                $this->softwareInformation() .
@@ -159,7 +159,7 @@ class SpecialVersion extends SpecialPage {
                                        <th>" . wfMessage( 'version-software-version' )->text() . "</th>
                                </tr>\n";
 
-               foreach( $software as $name => $version ) {
+               foreach ( $software as $name => $version ) {
                        $out .= "<tr>
                                        <td>" . $name . "</td>
                                        <td dir=\"ltr\">" . $version . "</td>
@@ -218,11 +218,11 @@ class SpecialVersion extends SpecialPage {
                wfProfileIn( __METHOD__ );
 
                $gitVersion = self::getVersionLinkedGit();
-               if( $gitVersion ) {
+               if ( $gitVersion ) {
                        $v = $gitVersion;
                } else {
                        $svnVersion = self::getVersionLinkedSvn();
-                       if( $svnVersion ) {
+                       if ( $svnVersion ) {
                                $v = $svnVersion;
                        } else {
                                $v = $wgVersion; // fallback
@@ -240,7 +240,7 @@ class SpecialVersion extends SpecialPage {
                global $IP;
 
                $info = self::getSvnInfo( $IP );
-               if( !isset( $info['checkout-rev'] ) ) {
+               if ( !isset( $info['checkout-rev'] ) ) {
                        return false;
                }
 
@@ -265,7 +265,7 @@ class SpecialVersion extends SpecialPage {
        private static function getwgVersionLinked() {
                global $wgVersion;
                $versionUrl = "";
-               if( wfRunHooks( 'SpecialVersionVersionUrl', array( $wgVersion, &$versionUrl ) ) ) {
+               if ( wfRunHooks( 'SpecialVersionVersionUrl', array( $wgVersion, &$versionUrl ) ) ) {
                        $versionParts = array();
                        preg_match( "/^(\d+\.\d+)/", $wgVersion, $versionParts );
                        $versionUrl = "https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]}";
@@ -282,7 +282,7 @@ class SpecialVersion extends SpecialPage {
 
                $gitInfo = new GitInfo( $IP );
                $headSHA1 = $gitInfo->getHeadSHA1();
-               if( !$headSHA1 ) {
+               if ( !$headSHA1 ) {
                        return false;
                }
 
@@ -407,7 +407,7 @@ class SpecialVersion extends SpecialPage {
                }
 
                $fhooks = $wgParser->getFunctionHooks();
-               if( count( $fhooks ) ) {
+               if ( count( $fhooks ) ) {
                        $out .= $this->openExtType( $this->msg( 'version-parser-function-hooks' )->text(), 'parser-function-hooks' );
                        $out .= '<tr><td colspan="4">' . $this->listToText( $fhooks ) . "</td></tr>\n";
                }
@@ -452,7 +452,7 @@ class SpecialVersion extends SpecialPage {
         * @return int
         */
        function compare( $a, $b ) {
-               if( $a['name'] === $b['name'] ) {
+               if ( $a['name'] === $b['name'] ) {
                        return 0;
                } else {
                        return $this->getLanguage()->lc( $a['name'] ) > $this->getLanguage()->lc( $b['name'] )
@@ -486,7 +486,7 @@ class SpecialVersion extends SpecialPage {
                                }
                                $gitHeadCommitDate = $gitInfo->getHeadCommitDate();
                                if ( $gitHeadCommitDate ) {
-                                       $vcsText .= "<br/>" .  $wgLang->timeanddate( $gitHeadCommitDate, true );
+                                       $vcsText .= "<br/>" . $wgLang->timeanddate( $gitHeadCommitDate, true );
                                }
                        } else {
                                $svnInfo = self::getSvnInfo( dirname( $extension['path'] ) );
@@ -517,11 +517,11 @@ class SpecialVersion extends SpecialPage {
                # Make description text.
                $description = isset ( $extension['description'] ) ? $extension['description'] : '';
 
-               if( isset ( $extension['descriptionmsg'] ) ) {
+               if ( isset ( $extension['descriptionmsg'] ) ) {
                        # Look for a localized description.
                        $descriptionMsg = $extension['descriptionmsg'];
 
-                       if( is_array( $descriptionMsg ) ) {
+                       if ( is_array( $descriptionMsg ) ) {
                                $descriptionMsgKey = $descriptionMsg[0]; // Get the message key
                                array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only
                                array_map( "htmlspecialchars", $descriptionMsg ); // For sanity
@@ -576,21 +576,22 @@ class SpecialVersion extends SpecialPage {
 
                        $ret .= Xml::closeElement( 'table' );
                        return $ret;
-               } else
+               } else {
                        return '';
+               }
        }
 
        private function openExtType( $text, $name = null ) {
                $opt = array( 'colspan' => 4 );
                $out = '';
 
-               if( $this->firstExtOpened ) {
+               if ( $this->firstExtOpened ) {
                        // Insert a spacing line
                        $out .= '<tr class="sv-space">' . Html::element( 'td', $opt ) . "</tr>\n";
                }
                $this->firstExtOpened = true;
 
-               if( $name ) {
+               if ( $name ) {
                        $opt['id'] = "sv-$name";
                }
 
@@ -617,7 +618,7 @@ class SpecialVersion extends SpecialPage {
         */
        function listAuthors( $authors ) {
                $list = array();
-               foreach( (array)$authors as $item ) {
+               foreach ( (array)$authors as $item ) {
                        if ( $item == '...' ) {
                                $list[] = $this->msg( 'version-poweredby-others' )->text();
                        } elseif ( substr( $item, -5 ) == ' ...]' ) {
@@ -662,16 +663,16 @@ class SpecialVersion extends SpecialPage {
         * @return Mixed
         */
        public static function arrayToString( $list ) {
-               if( is_array( $list ) && count( $list ) == 1 ) {
+               if ( is_array( $list ) && count( $list ) == 1 ) {
                        $list = $list[0];
                }
-               if( is_object( $list ) ) {
+               if ( is_object( $list ) ) {
                        $class = wfMessage( 'parentheses' )->params( get_class( $list ) )->escaped();
                        return $class;
                } elseif ( !is_array( $list ) ) {
                        return $list;
                } else {
-                       if( is_object( $list[0] ) ) {
+                       if ( is_object( $list[0] ) ) {
                                $class = get_class( $list[0] );
                        } else {
                                $class = $list[0];
@@ -700,7 +701,7 @@ class SpecialVersion extends SpecialPage {
                // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html
                $entries = $dir . '/.svn/entries';
 
-               if( !file_exists( $entries ) ) {
+               if ( !file_exists( $entries ) ) {
                        return false;
                }
 
@@ -710,9 +711,9 @@ class SpecialVersion extends SpecialPage {
                }
 
                // check if file is xml (subversion release <= 1.3) or not (subversion release = 1.4)
-               if( preg_match( '/^<\?xml/', $lines[0] ) ) {
+               if ( preg_match( '/^<\?xml/', $lines[0] ) ) {
                        // subversion is release <= 1.3
-                       if( !function_exists( 'simplexml_load_file' ) ) {
+                       if ( !function_exists( 'simplexml_load_file' ) ) {
                                // We could fall back to expat... YUCK
                                return false;
                        }
@@ -722,11 +723,11 @@ class SpecialVersion extends SpecialPage {
                        $xml = simplexml_load_file( $entries );
                        wfRestoreWarnings();
 
-                       if( $xml ) {
-                               foreach( $xml->entry as $entry ) {
-                                       if( $xml->entry[0]['name'] == '' ) {
+                       if ( $xml ) {
+                               foreach ( $xml->entry as $entry ) {
+                                       if ( $xml->entry[0]['name'] == '' ) {
                                                // The directory entry should always have a revision marker.
-                                               if( $entry['revision'] ) {
+                                               if ( $entry['revision'] ) {
                                                        return array( 'checkout-rev' => intval( $entry['revision'] ) );
                                                }
                                        }
index 303df34..ff4313f 100644 (file)
@@ -41,7 +41,7 @@ class SpecialWatchlist extends SpecialPage {
                $output = $this->getOutput();
 
                # Anons don't get a watchlist
-               if( $user->isAnon() ) {
+               if ( $user->isAnon() ) {
                        $output->setPageTitle( $this->msg( 'watchnologin' ) );
                        $output->setRobotPolicy( 'noindex,nofollow' );
                        $llink = Linker::linkKnown(
@@ -74,7 +74,7 @@ class SpecialWatchlist extends SpecialPage {
                $request = $this->getRequest();
 
                $mode = SpecialEditWatchlist::getMode( $request, $par );
-               if( $mode !== false ) {
+               if ( $mode !== false ) {
                        # TODO: localise?
                        switch( $mode ) {
                                case SpecialEditWatchlist::EDIT_CLEAR:
@@ -101,21 +101,21 @@ class SpecialWatchlist extends SpecialPage {
 
                // @TODO: use FormOptions!
                $defaults = array(
-               /* float */ 'days'      => floatval( $user->getOption( 'watchlistdays' ) ), /* 3.0 or 0.5, watch further below */
+               /* float */ 'days' => floatval( $user->getOption( 'watchlistdays' ) ), /* 3.0 or 0.5, watch further below */
                /* bool  */ 'hideMinor' => (int)$user->getBoolOption( 'watchlisthideminor' ),
-               /* bool  */ 'hideBots'  => (int)$user->getBoolOption( 'watchlisthidebots' ),
+               /* bool  */ 'hideBots' => (int)$user->getBoolOption( 'watchlisthidebots' ),
                /* bool  */ 'hideAnons' => (int)$user->getBoolOption( 'watchlisthideanons' ),
-               /* bool  */ 'hideLiu'   => (int)$user->getBoolOption( 'watchlisthideliu' ),
+               /* bool  */ 'hideLiu' => (int)$user->getBoolOption( 'watchlisthideliu' ),
                /* bool  */ 'hidePatrolled' => (int)$user->getBoolOption( 'watchlisthidepatrolled' ),
-               /* bool  */ 'hideOwn'   => (int)$user->getBoolOption( 'watchlisthideown' ),
-               /* bool  */ 'extended'   => (int)$user->getBoolOption( 'extendwatchlist' ),
+               /* bool  */ 'hideOwn' => (int)$user->getBoolOption( 'watchlisthideown' ),
+               /* bool  */ 'extended' => (int)$user->getBoolOption( 'extendwatchlist' ),
                /* ?     */ 'namespace' => '', //means all
-               /* ?     */ 'invert'    => false,
+               /* ?     */ 'invert' => false,
                /* bool  */ 'associated' => false,
                );
                $this->customFilters = array();
                wfRunHooks( 'SpecialWatchlistFilters', array( $this, &$this->customFilters ) );
-               foreach( $this->customFilters as $key => $params ) {
+               foreach ( $this->customFilters as $key => $params ) {
                        $defaults[$key] = $params['default'];
                }
 
@@ -130,7 +130,7 @@ class SpecialWatchlist extends SpecialPage {
                $values['hideOwn'] = (int)$request->getBool( 'hideOwn', $defaults['hideOwn'] );
                $values['hidePatrolled'] = (int)$request->getBool( 'hidePatrolled', $defaults['hidePatrolled'] );
                $values['extended'] = (int)$request->getBool( 'extended', $defaults['extended'] );
-               foreach( $this->customFilters as $key => $params ) {
+               foreach ( $this->customFilters as $key => $params ) {
                        $values[$key] = (int)$request->getBool( $key, $defaults[$key] );
                }
 
@@ -159,9 +159,9 @@ class SpecialWatchlist extends SpecialPage {
                $values['invert'] = $invert;
                $values['associated'] = $associated;
 
-               if( is_null( $values['days'] ) || !is_numeric( $values['days'] ) ) {
+               if ( is_null( $values['days'] ) || !is_numeric( $values['days'] ) ) {
                        $big = 1000; /* The magical big */
-                       if( $nitems > $big ) {
+                       if ( $nitems > $big ) {
                                # Set default cutoff shorter
                                $values['days'] = $defaults['days'] = (12.0 / 24.0); # 12 hours...
                        } else {
@@ -177,7 +177,7 @@ class SpecialWatchlist extends SpecialPage {
                        wfAppendToArrayIfNotDefault( $name, $values[$name], $defaults, $nondefaults );
                }
 
-               if( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $request->getVal( 'reset' ) &&
+               if ( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $request->getVal( 'reset' ) &&
                        $request->wasPosted() )
                {
                        $user->clearAllNotifications();
@@ -188,7 +188,7 @@ class SpecialWatchlist extends SpecialPage {
                # Possible where conditions
                $conds = array();
 
-               if( $values['days'] > 0 ) {
+               if ( $values['days'] > 0 ) {
                        $conds[] = 'rc_timestamp > ' . $dbr->addQuotes( $dbr->timestamp( time() - intval( $values['days'] * 86400 ) ) );
                }
 
@@ -201,19 +201,19 @@ class SpecialWatchlist extends SpecialPage {
                # Up estimate of watched items by 15% to compensate for talk pages...
 
                # Toggles
-               if( $values['hideOwn'] ) {
+               if ( $values['hideOwn'] ) {
                        $conds[] = 'rc_user != ' . $user->getId();
                }
-               if( $values['hideBots'] ) {
+               if ( $values['hideBots'] ) {
                        $conds[] = 'rc_bot = 0';
                }
-               if( $values['hideMinor'] ) {
+               if ( $values['hideMinor'] ) {
                        $conds[] = 'rc_minor = 0';
                }
-               if( $values['hideLiu'] ) {
+               if ( $values['hideLiu'] ) {
                        $conds[] = 'rc_user = 0';
                }
-               if( $values['hideAnons'] ) {
+               if ( $values['hideAnons'] ) {
                        $conds[] = 'rc_user != 0';
                }
                if ( $user->useRCPatrol() && $values['hidePatrolled'] ) {
@@ -224,7 +224,7 @@ class SpecialWatchlist extends SpecialPage {
                }
 
                # Toggle watchlist content (all recent edits or just the latest)
-               if( $values['extended'] ) {
+               if ( $values['extended'] ) {
                        $limitWatchlist = $user->getIntOption( 'wllimit' );
                        $usePage = false;
                } else {
@@ -236,7 +236,7 @@ class SpecialWatchlist extends SpecialPage {
 
                # Show a message about slave lag, if applicable
                $lag = wfGetLB()->safeGetLag( $dbr );
-               if( $lag > 0 ) {
+               if ( $lag > 0 ) {
                        $output->showLagWarning( $lag );
                }
 
@@ -246,10 +246,10 @@ class SpecialWatchlist extends SpecialPage {
                # Show watchlist header
                $form .= $this->msg( 'watchlist-details' )->numParams( $nitems )->parse() . "\n";
 
-               if( $user->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist ) {
+               if ( $user->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist ) {
                        $form .= $this->msg( 'wlheader-enotif' )->parseAsBlock() . "\n";
                }
-               if( $wgShowUpdatedMarker ) {
+               if ( $wgShowUpdatedMarker ) {
                        $form .= Xml::openElement( 'form', array( 'method' => 'post',
                                                'action' => $this->getTitle()->getLocalURL(),
                                                'id' => 'mw-watchlist-resetbutton' ) ) . "\n" .
@@ -276,10 +276,10 @@ class SpecialWatchlist extends SpecialPage {
                        ),
                );
                $options = array( 'ORDER BY' => 'rc_timestamp DESC' );
-               if( $wgShowUpdatedMarker ) {
+               if ( $wgShowUpdatedMarker ) {
                        $fields[] = 'wl_notificationtimestamp';
                }
-               if( $limitWatchlist ) {
+               if ( $limitWatchlist ) {
                        $options['LIMIT'] = $limitWatchlist;
                }
 
@@ -302,7 +302,7 @@ class SpecialWatchlist extends SpecialPage {
 
                $lang = $this->getLanguage();
                $wlInfo = '';
-               if( $values['days'] > 0 ) {
+               if ( $values['days'] > 0 ) {
                        $timestamp = wfTimestampNow();
                        $wlInfo = $this->msg( 'wlnote' )->numParams( $numRows, round( $values['days'] * 24 ) )->params(
                                $lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user ) )->parse() . "<br />\n";
@@ -312,11 +312,11 @@ class SpecialWatchlist extends SpecialPage {
 
                # Spit out some control panel links
                $filters = array(
-                       'hideMinor'     => 'rcshowhideminor',
-                       'hideBots'              => 'rcshowhidebots',
-                       'hideAnons'     => 'rcshowhideanons',
-                       'hideLiu'               => 'rcshowhideliu',
-                       'hideOwn'               => 'rcshowhidemine',
+                       'hideMinor' => 'rcshowhideminor',
+                       'hideBots' => 'rcshowhidebots',
+                       'hideAnons' => 'rcshowhideanons',
+                       'hideLiu' => 'rcshowhideliu',
+                       'hideOwn' => 'rcshowhidemine',
                        'hidePatrolled' => 'rcshowhidepatr'
                );
                foreach ( $this->customFilters as $key => $params ) {
@@ -328,7 +328,7 @@ class SpecialWatchlist extends SpecialPage {
                }
 
                $links = array();
-               foreach( $filters as $name => $msg ) {
+               foreach ( $filters as $name => $msg ) {
                        $links[] = $this->showHideLink( $nondefaults, $msg, $name, $values[$name] );
                }
 
@@ -349,8 +349,8 @@ class SpecialWatchlist extends SpecialPage {
                                'all' => '',
                                'label' => $this->msg( 'namespace' )->text()
                        ), array(
-                               'name'  => 'namespace',
-                               'id'    => 'namespace',
+                               'name' => 'namespace',
+                               'id' => 'namespace',
                                'class' => 'namespaceselector',
                        )
                ) . '&#160;';
@@ -377,7 +377,7 @@ class SpecialWatchlist extends SpecialPage {
                $output->addHTML( $form );
 
                # If there's nothing to show, stop here
-               if( $numRows == 0 ) {
+               if ( $numRows == 0 ) {
                        $output->addWikiMsg( 'watchnochange' );
                        return;
                }
@@ -477,11 +477,11 @@ class SpecialWatchlist extends SpecialPage {
                $hours = array( 1, 2, 6, 12 );
                $days = array( 1, 3, 7 );
                $i = 0;
-               foreach( $hours as $h ) {
+               foreach ( $hours as $h ) {
                        $hours[$i++] = $this->hoursLink( $h, $options );
                }
                $i = 0;
-               foreach( $days as $d ) {
+               foreach ( $days as $d ) {
                        $days[$i++] = $this->daysLink( $d, $options );
                }
                return $this->msg( 'wlshowlast' )->rawParams(
index 57bb7d0..05c7dd5 100644 (file)
@@ -77,7 +77,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                $this->opts = $opts;
 
                $this->target = Title::newFromURL( $opts->getValue( 'target' ) );
-               if( !$this->target ) {
+               if ( !$this->target ) {
                        $out->addHTML( $this->whatlinkshereForm() );
                        return;
                }
@@ -111,7 +111,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                $hidetrans = $this->opts->getValue( 'hidetrans' );
                $hideimages = $target->getNamespace() != NS_FILE || $this->opts->getValue( 'hideimages' );
 
-               $fetchlinks = (!$hidelinks || !$hideredirs);
+               $fetchlinks = ( !$hidelinks || !$hideredirs );
 
                // Make the query
                $plConds = array(
@@ -119,9 +119,9 @@ class SpecialWhatLinksHere extends SpecialPage {
                        'pl_namespace' => $target->getNamespace(),
                        'pl_title' => $target->getDBkey(),
                );
-               if( $hideredirs ) {
+               if ( $hideredirs ) {
                        $plConds['rd_from'] = null;
-               } elseif( $hidelinks ) {
+               } elseif ( $hidelinks ) {
                        $plConds[] = 'rd_from is NOT NULL';
                }
 
@@ -166,7 +166,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                        'rd_interwiki = ' . $dbr->addQuotes( '' ) . ' OR rd_interwiki IS NULL'
                )));
 
-               if( $fetchlinks ) {
+               if ( $fetchlinks ) {
                        $options['ORDER BY'] = 'pl_from';
                        $plRes = $dbr->select( array( 'pagelinks', 'page', 'redirect' ), $fields,
                                $plConds, __METHOD__, $options,
@@ -174,7 +174,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                        );
                }
 
-               if( !$hidetrans ) {
+               if ( !$hidetrans ) {
                        $options['ORDER BY'] = 'tl_from';
                        $tlRes = $dbr->select( array( 'templatelinks', 'page', 'redirect' ), $fields,
                                $tlConds, __METHOD__, $options,
@@ -182,7 +182,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                        );
                }
 
-               if( !$hideimages ) {
+               if ( !$hideimages ) {
                        $options['ORDER BY'] = 'il_from';
                        $ilRes = $dbr->select( array( 'imagelinks', 'page', 'redirect' ), $fields,
                                $ilConds, __METHOD__, $options,
@@ -190,13 +190,14 @@ class SpecialWhatLinksHere extends SpecialPage {
                        );
                }
 
-               if( ( !$fetchlinks || !$plRes->numRows() ) && ( $hidetrans || !$tlRes->numRows() ) && ( $hideimages || !$ilRes->numRows() ) ) {
+               if ( ( !$fetchlinks || !$plRes->numRows() ) && ( $hidetrans || !$tlRes->numRows() ) && ( $hideimages || !$ilRes->numRows() ) ) {
                        if ( 0 == $level ) {
                                $out->addHTML( $this->whatlinkshereForm() );
 
                                // Show filters only if there are links
-                               if( $hidelinks || $hidetrans || $hideredirs || $hideimages )
+                               if ( $hidelinks || $hidetrans || $hideredirs || $hideimages ) {
                                        $out->addHTML( $this->getFilterPanel() );
+                               }
 
                                $errMsg = is_int( $namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
                                $out->addWikiMsg( $errMsg, $this->target->getPrefixedText() );
@@ -207,21 +208,21 @@ class SpecialWhatLinksHere extends SpecialPage {
                // Read the rows into an array and remove duplicates
                // templatelinks comes second so that the templatelinks row overwrites the
                // pagelinks row, so we get (inclusion) rather than nothing
-               if( $fetchlinks ) {
+               if ( $fetchlinks ) {
                        foreach ( $plRes as $row ) {
                                $row->is_template = 0;
                                $row->is_image = 0;
                                $rows[$row->page_id] = $row;
                        }
                }
-               if( !$hidetrans ) {
+               if ( !$hidetrans ) {
                        foreach ( $tlRes as $row ) {
                                $row->is_template = 1;
                                $row->is_image = 0;
                                $rows[$row->page_id] = $row;
                        }
                }
-               if( !$hideimages ) {
+               if ( !$hideimages ) {
                        foreach ( $ilRes as $row ) {
                                $row->is_template = 0;
                                $row->is_image = 1;
@@ -272,7 +273,7 @@ class SpecialWhatLinksHere extends SpecialPage {
 
                $out->addHTML( $this->listEnd() );
 
-               if( $level == 0 ) {
+               if ( $level == 0 ) {
                        $out->addHTML( $prevnext );
                }
        }
@@ -295,7 +296,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                        }
                }
 
-               if( $row->rd_from ) {
+               if ( $row->rd_from ) {
                        $query = array( 'redirect' => 'no' );
                } else {
                        $query = array();
@@ -311,12 +312,15 @@ class SpecialWhatLinksHere extends SpecialPage {
                // Display properties (redirect or template)
                $propsText = '';
                $props = array();
-               if ( $row->rd_from )
+               if ( $row->rd_from ) {
                        $props[] = $msgcache['isredirect'];
-               if ( $row->is_template )
+               }
+               if ( $row->is_template ) {
                        $props[] = $msgcache['istemplate'];
-               if( $row->is_image )
+               }
+               if ( $row->is_image ) {
                        $props[] = $msgcache['isimage'];
+               }
 
                if ( count( $props ) ) {
                        $propsText = $this->msg( 'parentheses' )->rawParams( implode( $msgcache['semicolon-separator'], $props ) )->escaped();
@@ -337,8 +341,9 @@ class SpecialWhatLinksHere extends SpecialPage {
 
        protected function wlhLink( Title $target, $text ) {
                static $title = null;
-               if ( $title === null )
+               if ( $title === null ) {
                        $title = $this->getTitle();
+               }
 
                return Linker::linkKnown(
                        $title,
@@ -422,8 +427,8 @@ class SpecialWhatLinksHere extends SpecialPage {
                                'all' => '',
                                'label' => $this->msg( 'namespace' )->text()
                        ), array(
-                               'name'  => 'namespace',
-                               'id'    => 'namespace',
+                               'name' => 'namespace',
+                               'id' => 'namespace',
                                'class' => 'namespaceselector',
                        )
                );
@@ -453,12 +458,13 @@ class SpecialWhatLinksHere extends SpecialPage {
 
                $links = array();
                $types = array( 'hidetrans', 'hidelinks', 'hideredirs' );
-               if( $this->target->getNamespace() == NS_FILE )
+               if ( $this->target->getNamespace() == NS_FILE ) {
                        $types[] = 'hideimages';
+               }
 
                // Combined message keys: 'whatlinkshere-hideredirs', 'whatlinkshere-hidetrans', 'whatlinkshere-hidelinks', 'whatlinkshere-hideimages'
                // To be sure they will be found by grep
-               foreach( $types as $type ) {
+               foreach ( $types as $type ) {
                        $chosen = $this->opts->getValue( $type );
                        $msg = $chosen ? $show : $hide;
                        $overrides = array( $type => !$chosen );
index c18c963..9d23499 100644 (file)
@@ -44,7 +44,7 @@ class WithoutInterwikiPage extends PageQueryPage {
                global $wgScript;
 
                # Do not show useless input form if special page is cached
-               if( $this->isCached() ) {
+               if ( $this->isCached() ) {
                        return '';
                }