Update formatting
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Sun, 14 Apr 2013 17:27:14 +0000 (19:27 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 20 Apr 2013 08:02:19 +0000 (10:02 +0200)
Change-Id: I0e334d910a311f067276215b6bff94cd814fc3b3

26 files changed:
includes/specials/SpecialAllmessages.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialAncientpages.php
includes/specials/SpecialBlock.php
includes/specials/SpecialBlockList.php
includes/specials/SpecialBlockme.php
includes/specials/SpecialBooksources.php
includes/specials/SpecialBrokenRedirects.php
includes/specials/SpecialCachedPage.php
includes/specials/SpecialCategories.php
includes/specials/SpecialChangeEmail.php
includes/specials/SpecialChangePassword.php
includes/specials/SpecialComparePages.php
includes/specials/SpecialConfirmemail.php
includes/specials/SpecialContributions.php
includes/specials/SpecialDeadendpages.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialDisambiguations.php
includes/specials/SpecialDoubleRedirects.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialEmailuser.php
includes/specials/SpecialExport.php
includes/specials/SpecialFewestrevisions.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialFilepath.php
includes/specials/SpecialImport.php

index 16652a9..35d6a0c 100644 (file)
@@ -54,6 +54,7 @@ class SpecialAllmessages extends SpecialPage {
                global $wgUseDatabaseMessages;
                if ( !$wgUseDatabaseMessages ) {
                        $out->addWikiMsg( 'allmessagesnotsupportedDB' );
+
                        return;
                } else {
                        $this->outputHeader( 'allmessagestext' );
@@ -73,7 +74,6 @@ class SpecialAllmessages extends SpecialPage {
                        $this->table->getNavigationBar() .
                        $this->table->getBody() .
                        $this->table->getNavigationBar() );
-
        }
 
        protected function getGroupName() {
@@ -211,6 +211,7 @@ class AllmessagesTablePager extends TablePager {
                        $this->getHiddenFields( array( 'title', 'prefix', 'filter', 'lang', 'limit' ) ) .
                        Xml::closeElement( 'fieldset' ) .
                        Xml::closeElement( 'form' );
+
                return $out;
        }
 
@@ -227,6 +228,7 @@ class AllmessagesTablePager extends TablePager {
                $messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
 
                wfProfileOut( __METHOD__ );
+
                return $messageNames;
        }
 
@@ -317,6 +319,7 @@ class AllmessagesTablePager extends TablePager {
                                break;
                        }
                }
+
                return $result;
        }
 
@@ -365,6 +368,7 @@ class AllmessagesTablePager extends TablePager {
                                                array( 'broken' )
                                        );
                                }
+
                                return $title . ' ' . $this->msg( 'parentheses' )->rawParams( $talk )->escaped();
 
                        case 'am_default' :
@@ -388,6 +392,7 @@ class AllmessagesTablePager extends TablePager {
                        $s .= Xml::tags( 'td', $this->getCellAttrs( 'am_actual', $row->am_actual ), $formatted )
                                . "</tr>\n";
                }
+
                return $s;
        }
 
@@ -399,6 +404,7 @@ class AllmessagesTablePager extends TablePager {
                if ( !$isSecond ) {
                        $arr['id'] = Sanitizer::escapeId( 'msg_' . $this->getLanguage()->lcfirst( $row->am_title ) );
                }
+
                return $arr;
        }
 
index 8c93520..98ec4f6 100644 (file)
@@ -159,6 +159,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                $out .= Xml::closeElement( 'fieldset' );
                $out .= Xml::closeElement( 'form' );
                $out .= Xml::closeElement( 'div' );
+
                return $out;
        }
 
@@ -258,6 +259,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                        } else {
                                $output->addHTML( $this->namespaceForm( $namespace, $from, $to, $hideredirects ) );
                        }
+
                        return;
                }
 
@@ -317,7 +319,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                        'to' => $outpoint,
                );
 
-               if( $namespace ) {
+               if ( $namespace ) {
                        $queryParams['namespace'] = $namespace;
                }
                if ( $hideRedirects ) {
@@ -331,6 +333,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                        "<a href=\"$link\">$inpointf</a></td><td>",
                        "</td><td><a href=\"$link\">$outpointf</a>"
                )->escaped();
+
                return '<tr><td class="mw-allpages-alphaindexline">' . $out . '</td></tr>';
        }
 
@@ -531,7 +534,6 @@ class SpecialAllpages extends IncludableSpecialPage {
                                        )
                        );
                }
-
        }
 
        /**
index 5d0b79f..b083032 100644 (file)
@@ -78,6 +78,7 @@ class AncientPagesPage extends QueryPage {
                        $title,
                        htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
                );
+
                return $this->getLanguage()->specialList( $link, htmlspecialchars( $d ) );
        }
 
index 2a5e504..645de23 100644 (file)
@@ -444,6 +444,7 @@ class SpecialBlock extends FormSpecialPage {
                } elseif ( IP::isIPAddress( $target ) ) {
                        return Title::makeTitleSafe( NS_USER, $target );
                }
+
                return null;
        }
 
@@ -510,6 +511,7 @@ class SpecialBlock extends FormSpecialPage {
                $status = self::validateTarget( $value, $form->getUser() );
                if ( !$status->isOK() ) {
                        $errors = $status->getErrorsArray();
+
                        return call_user_func_array( array( $form, 'msg' ), $errors[0] );
                } else {
                        return true;
@@ -954,4 +956,5 @@ class SpecialBlock extends FormSpecialPage {
 }
 
 # BC @since 1.18
-class IPBlockForm extends SpecialBlock {}
+class IPBlockForm extends SpecialBlock {
+}
index 4868a75..b83b499 100644 (file)
@@ -59,6 +59,7 @@ class SpecialBlockList extends SpecialPage {
                        # B/C @since 1.18: Unblock interface is now at Special:Unblock
                        $title = SpecialPage::getTitleFor( 'Unblock', $this->target );
                        $out->redirect( $title->getFullURL() );
+
                        return;
                }
 
@@ -182,10 +183,8 @@ class SpecialBlockList extends SpecialPage {
                                        $pager->getBody() .
                                        $pager->getNavigationBar()
                        );
-
                } elseif ( $this->target ) {
                        $out->addWikiMsg( 'ipblocklist-no-results' );
-
                } else {
                        $out->addWikiMsg( 'ipblocklist-empty' );
                }
@@ -482,5 +481,4 @@ class HTMLBlockedUsersItemSelect extends HTMLSelectField {
 
                return true;
        }
-
 }
index 1e5b524..c3d6080 100644 (file)
@@ -41,6 +41,7 @@ class SpecialBlockme extends UnlistedSpecialPage {
                $ip = $this->getRequest()->getIP();
                if ( !$wgBlockOpenProxies || $this->getRequest()->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) {
                        $this->getOutput()->addWikiMsg( 'proxyblocker-disabled' );
+
                        return;
                }
 
index b3933c5..3170c29 100644 (file)
@@ -95,6 +95,7 @@ class SpecialBookSources extends SpecialPage {
                                return true;
                        }
                }
+
                return false;
        }
 
@@ -124,6 +125,7 @@ class SpecialBookSources extends SpecialPage {
                $form .= '&#160;' . Xml::submitButton( $this->msg( 'booksources-go' )->text() ) . "</p>\n";
                $form .= Html::closeElement( 'form' ) . "\n";
                $form .= Html::closeElement( 'fieldset' ) . "\n";
+
                return $form;
        }
 
@@ -153,6 +155,7 @@ class SpecialBookSources extends SpecialPage {
 
                                $text = $content->getNativeData();
                                $this->getOutput()->addWikiText( str_replace( 'MAGICNUMBER', $this->isbn, $text ) );
+
                                return true;
                        } else {
                                throw new MWException( "Unexpected content type for book sources: " . $content->getModel() );
@@ -166,6 +169,7 @@ class SpecialBookSources extends SpecialPage {
                foreach ( $items as $label => $url )
                        $this->getOutput()->addHTML( $this->makeListItem( $label, $url ) );
                $this->getOutput()->addHTML( '</ul>' );
+
                return true;
        }
 
@@ -178,6 +182,7 @@ class SpecialBookSources extends SpecialPage {
         */
        private function makeListItem( $label, $url ) {
                $url = str_replace( '$1', $this->isbn, $url );
+
                return Html::rawElement( 'li', array(),
                        Html::element( 'a', array( 'href' => $url, 'class' => 'external' ), $label ) );
        }
index dd878cf..b2ddc22 100644 (file)
@@ -51,6 +51,7 @@ class BrokenRedirectsPage extends QueryPage {
 
        function getQueryInfo() {
                $dbr = wfGetDB( DB_SLAVE );
+
                return array(
                        'tables' => array(
                                'redirect',
@@ -149,6 +150,7 @@ class BrokenRedirectsPage extends QueryPage {
 
                $out .= $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->pipeList( $links ) )->escaped();
                $out .= " {$arr} {$to}";
+
                return $out;
        }
 
index ddd11ad..39305f0 100644 (file)
@@ -194,5 +194,4 @@ abstract class SpecialCachedPage extends SpecialPage implements ICacheHelper {
                        $this->getOutput()->setSubtitle( $this->cacheHelper->getCachedNotice( $this->getContext() ) );
                }
        }
-
 }
index f7256a4..d01bfd7 100644 (file)
@@ -90,6 +90,7 @@ class CategoryPager extends AlphabeticPager {
        function getDefaultQuery() {
                parent::getDefaultQuery();
                unset( $this->mDefaultQuery['from'] );
+
                return $this->mDefaultQuery;
        }
 
@@ -114,6 +115,7 @@ class CategoryPager extends AlphabeticPager {
                }
                $batch->execute();
                $this->mResult->rewind();
+
                return parent::getBody();
        }
 
@@ -121,6 +123,7 @@ class CategoryPager extends AlphabeticPager {
                $title = Title::makeTitle( NS_CATEGORY, $result->cat_title );
                $titleText = Linker::link( $title, htmlspecialchars( $title->getText() ) );
                $count = $this->msg( 'nmembers' )->numParams( $result->cat_pages )->escaped();
+
                return Xml::tags( 'li', null, $this->getLanguage()->specialList( $titleText, $count ) ) . "\n";
        }
 
@@ -136,9 +139,9 @@ class CategoryPager extends AlphabeticPager {
                                        Xml::inputLabel(
                                                $this->msg( 'categoriesfrom' )->text(),
                                                'from', 'from', 20, $from ) .
-                                                       ' ' .
-                                                       Xml::submitButton( $this->msg( 'allpagessubmit' )->text()
-                                       )
+                                               ' ' .
+                                               Xml::submitButton( $this->msg( 'allpagessubmit' )->text()
+                                               )
                                )
                );
        }
index 2086fd3..9e435fb 100644 (file)
@@ -49,6 +49,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
         */
        function isListed() {
                global $wgAuth;
+
                return $wgAuth->allowPropChange( 'emailaddress' );
        }
 
@@ -67,6 +68,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
 
                if ( !$wgAuth->allowPropChange( 'emailaddress' ) ) {
                        $this->error( 'cannotchangeemail' );
+
                        return;
                }
 
@@ -75,11 +77,13 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
 
                if ( !$request->wasPosted() && !$user->isLoggedIn() ) {
                        $this->error( 'changeemail-no-info' );
+
                        return;
                }
 
                if ( $request->wasPosted() && $request->getBool( 'wpCancel' ) ) {
                        $this->doReturnTo();
+
                        return;
                }
 
@@ -203,6 +207,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
                        $out .= "</td>\n";
                        $out .= "</tr>";
                }
+
                return $out;
        }
 
@@ -217,18 +222,21 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
 
                if ( $newaddr != '' && !Sanitizer::validateEmail( $newaddr ) ) {
                        $this->error( 'invalidemailaddress' );
+
                        return false;
                }
 
                $throttleCount = LoginForm::incLoginThrottle( $user->getName() );
                if ( $throttleCount === true ) {
                        $this->error( 'login-throttled' );
+
                        return false;
                }
 
                global $wgRequirePasswordforEmailChange;
                if ( $wgRequirePasswordforEmailChange && !$user->checkTemporaryPassword( $pass ) && !$user->checkPassword( $pass ) ) {
                        $this->error( 'wrongpassword' );
+
                        return false;
                }
 
@@ -243,6 +251,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
                                '<p class="error">' .
                                        $this->getOutput()->parseInline( $status->getWikiText( 'mailerror' ) ) .
                                        '</p>' );
+
                        return false;
                }
 
index 95fbb0d..3f65520 100644 (file)
@@ -54,11 +54,13 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                $user = $this->getUser();
                if ( !$request->wasPosted() && !$user->isLoggedIn() ) {
                        $this->error( $this->msg( 'resetpass-no-info' )->text() );
+
                        return;
                }
 
                if ( $request->wasPosted() && $request->getBool( 'wpCancel' ) ) {
                        $this->doReturnTo();
+
                        return;
                }
 
@@ -69,6 +71,7 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                                $this->mDomain = $wgAuth->getDomain();
                                if ( !$wgAuth->allowPasswordChange() ) {
                                        $this->error( $this->msg( 'resetpass_forbidden' )->text() );
+
                                        return;
                                }
 
@@ -90,6 +93,7 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                                        $login->setContext( $this->getContext() );
                                        $login->execute( null );
                                }
+
                                return;
                        } catch ( PasswordError $e ) {
                                $this->error( $e->getMessage() );
@@ -218,6 +222,7 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                        $out .= "</td>\n";
                        $out .= "</tr>";
                }
+
                return $out;
        }
 
index 3b82326..fc6b0c5 100644 (file)
@@ -136,6 +136,7 @@ class SpecialComparePages extends SpecialPage {
                                return $title->getLatestRevID();
                        }
                }
+
                return null;
        }
 
@@ -150,6 +151,7 @@ class SpecialComparePages extends SpecialPage {
                if ( !$title->exists() ) {
                        return $this->msg( 'compare-title-not-exists' )->parseAsBlock();
                }
+
                return true;
        }
 
@@ -161,6 +163,7 @@ class SpecialComparePages extends SpecialPage {
                if ( $revision === null ) {
                        return $this->msg( 'compare-revision-not-exists' )->parseAsBlock();
                }
+
                return true;
        }
 
index c8190c8..47808d1 100644 (file)
@@ -125,6 +125,7 @@ class EmailConfirmation extends UnlistedSpecialPage {
                $user = User::newFromConfirmationCode( $code );
                if ( !is_object( $user ) ) {
                        $this->getOutput()->addWikiMsg( 'confirmemail_invalid' );
+
                        return;
                }
 
@@ -167,6 +168,7 @@ class EmailInvalidation extends UnlistedSpecialPage {
                $user = User::newFromConfirmationCode( $code );
                if ( !is_object( $user ) ) {
                        $this->getOutput()->addWikiMsg( 'confirmemail_invalid' );
+
                        return;
                }
 
index 932f05e..a0351a4 100644 (file)
@@ -64,6 +64,7 @@ class SpecialContributions extends SpecialPage {
 
                if ( !strlen( $target ) ) {
                        $out->addHTML( $this->getForm() );
+
                        return;
                }
 
@@ -76,11 +77,13 @@ class SpecialContributions extends SpecialPage {
                $nt = Title::makeTitleSafe( NS_USER, $target );
                if ( !$nt ) {
                        $out->addHTML( $this->getForm() );
+
                        return;
                }
                $userObj = User::newFromName( $nt->getText(), false );
                if ( !$userObj ) {
                        $out->addHTML( $this->getForm() );
+
                        return;
                }
                $id = $userObj->getID();
@@ -158,6 +161,7 @@ class SpecialContributions extends SpecialPage {
                        $url = wfAppendQuery( wfScript( 'api' ), $apiParams );
 
                        $out->redirect( $url, '301' );
+
                        return;
                }
 
@@ -270,6 +274,7 @@ class SpecialContributions extends SpecialPage {
                $oldMsg = $this->msg( 'contribsub' );
                if ( $oldMsg->exists() ) {
                        $linksWithParentheses = $this->msg( 'parentheses' )->rawParams( $links )->escaped();
+
                        return $oldMsg->rawParams( "$user $linksWithParentheses" );
                }
 
@@ -308,6 +313,7 @@ class SpecialContributions extends SpecialPage {
                                        );
                                }
                        }
+
                        # Block log link
                        $tools[] = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Log', 'block' ),
@@ -347,6 +353,7 @@ class SpecialContributions extends SpecialPage {
                }
 
                wfRunHooks( 'ContributionsToolLinks', array( $id, $userpage, &$tools ) );
+
                return $tools;
        }
 
@@ -496,32 +503,32 @@ class SpecialContributions extends SpecialPage {
                                        'class' => 'namespaceselector',
                                )
                        ) . '&#160;' .
-                       Html::rawElement(
-                               'span',
-                               array( 'style' => 'white-space: nowrap' ),
-                               Xml::checkLabel(
-                                       $this->msg( 'invert' )->text(),
-                                       'nsInvert',
-                                       'nsInvert',
-                                       $this->opts['nsInvert'],
-                                       array(
-                                               'title' => $this->msg( 'tooltip-invert' )->text(),
-                                               'class' => 'mw-input'
-                                       )
-                               ) . '&#160;'
-                       ) .
-                       Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),
-                               Xml::checkLabel(
-                                       $this->msg( 'namespace_association' )->text(),
-                                       'associated',
-                                       'associated',
-                                       $this->opts['associated'],
-                                       array(
-                                               'title' => $this->msg( 'tooltip-namespace_association' )->text(),
-                                               'class' => 'mw-input'
-                                       )
-                               ) . '&#160;'
-                       )
+                               Html::rawElement(
+                                       'span',
+                                       array( 'style' => 'white-space: nowrap' ),
+                                       Xml::checkLabel(
+                                               $this->msg( 'invert' )->text(),
+                                               'nsInvert',
+                                               'nsInvert',
+                                               $this->opts['nsInvert'],
+                                               array(
+                                                       'title' => $this->msg( 'tooltip-invert' )->text(),
+                                                       'class' => 'mw-input'
+                                               )
+                                       ) . '&#160;'
+                               ) .
+                               Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),
+                                       Xml::checkLabel(
+                                               $this->msg( 'namespace_association' )->text(),
+                                               'associated',
+                                               'associated',
+                                               $this->opts['associated'],
+                                               array(
+                                                       'title' => $this->msg( 'tooltip-namespace_association' )->text(),
+                                                       'class' => 'mw-input'
+                                               )
+                                       ) . '&#160;'
+                               )
                );
 
                if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
@@ -644,6 +651,7 @@ class ContribsPager extends ReverseChronologicalPager {
        function getDefaultQuery() {
                $query = parent::getDefaultQuery();
                $query['target'] = $this->target;
+
                return $query;
        }
 
@@ -753,6 +761,7 @@ class ContribsPager extends ReverseChronologicalPager {
                );
 
                wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
+
                return $queryInfo;
        }
 
@@ -1030,6 +1039,7 @@ class ContribsPager extends ReverseChronologicalPager {
                }
 
                wfProfileOut( __METHOD__ );
+
                return $ret;
        }
 
index 6978d6b..44137c1 100644 (file)
@@ -59,24 +59,29 @@ class DeadendPagesPage extends PageQueryPage {
        function getQueryInfo() {
                return array(
                        'tables' => array( 'page', 'pagelinks' ),
-                       'fields' => array( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'page_title'
+                       'fields' => array(
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'page_title'
                        ),
-                       'conds' => array( 'pl_from IS NULL',
-                                       'page_namespace' => MWNamespace::getContentNamespaces(),
-                                       'page_is_redirect' => 0
+                       'conds' => array(
+                               'pl_from IS NULL',
+                               'page_namespace' => MWNamespace::getContentNamespaces(),
+                               'page_is_redirect' => 0
                        ),
-                       'join_conds' => array( 'pagelinks' => array( 'LEFT JOIN', array(
-                                       'page_id=pl_from'
-                       ) ) )
+                       'join_conds' => array(
+                               'pagelinks' => array(
+                                       'LEFT JOIN',
+                                       array( 'page_id=pl_from' )
+                               )
+                       )
                );
        }
 
        function getOrderFields() {
                // For some crazy reason ordering by a constant
                // causes a filesort
-               if( count( MWNamespace::getContentNamespaces() ) > 1 ) {
+               if ( count( MWNamespace::getContentNamespaces() ) > 1 ) {
                        return array( 'page_namespace', 'page_title' );
                } else {
                        return array( 'page_title' );
index 901c7f9..28ca24b 100644 (file)
@@ -49,6 +49,7 @@ class DeletedContribsPager extends IndexPager {
        function getDefaultQuery() {
                $query = parent::getDefaultQuery();
                $query['target'] = $this->target;
+
                return $query;
        }
 
@@ -63,6 +64,7 @@ class DeletedContribsPager extends IndexPager {
                        $conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::SUPPRESSED_USER ) .
                                ' != ' . Revision::SUPPRESSED_USER;
                }
+
                return array(
                        'tables' => array( 'archive' ),
                        'fields' => array(
@@ -255,6 +257,7 @@ class DeletedContribsPager extends IndexPager {
                $ret = Html::rawElement( 'li', array(), $ret ) . "\n";
 
                wfProfileOut( __METHOD__ );
+
                return $ret;
        }
 
@@ -290,6 +293,7 @@ class DeletedContributionsPage extends SpecialPage {
 
                if ( !$this->userCanExecute( $user ) ) {
                        $this->displayRestrictionError();
+
                        return;
                }
 
@@ -307,6 +311,7 @@ class DeletedContributionsPage extends SpecialPage {
 
                if ( !strlen( $target ) ) {
                        $out->addHTML( $this->getForm( '' ) );
+
                        return;
                }
 
@@ -316,6 +321,7 @@ class DeletedContributionsPage extends SpecialPage {
                $userObj = User::newFromName( $target, false );
                if ( !$userObj ) {
                        $out->addHTML( $this->getForm( '' ) );
+
                        return;
                }
                $this->getSkin()->setRelevantUser( $userObj );
@@ -334,6 +340,7 @@ class DeletedContributionsPage extends SpecialPage {
                $pager = new DeletedContribsPager( $this->getContext(), $target, $options['namespace'] );
                if ( !$pager->getNumRows() ) {
                        $out->addWikiMsg( 'nocontribs' );
+
                        return;
                }
 
index 51262b4..ceecd15 100644 (file)
@@ -54,32 +54,35 @@ class DisambiguationsPage extends QueryPage {
                # If the text can be treated as a title, use it verbatim.
                # Otherwise, pull the titles from the links table
                $dp = Title::newFromText( $dMsgText );
-               if( $dp ) {
-                       if( $dp->getNamespace() != NS_TEMPLATE ) {
+               if ( $dp ) {
+                       if ( $dp->getNamespace() != NS_TEMPLATE ) {
                                # @todo FIXME: We assume the disambiguation message is a template but
                                # the page can potentially be from another namespace :/
                                wfDebug( "Mediawiki:disambiguationspage message does not refer to a template!\n" );
                        }
                        $linkBatch->addObj( $dp );
                } else {
-                               # Get all the templates linked from the Mediawiki:Disambiguationspage
-                               $disPageObj = Title::makeTitleSafe( NS_MEDIAWIKI, 'disambiguationspage' );
-                               $res = $dbr->select(
-                                       array( 'pagelinks', 'page' ),
-                                       'pl_title',
-                                       array( 'page_id = pl_from',
-                                               'pl_namespace' => NS_TEMPLATE,
-                                               'page_namespace' => $disPageObj->getNamespace(),
-                                               'page_title' => $disPageObj->getDBkey()
-                                       ), __METHOD__ );
-
-                               foreach ( $res as $row ) {
-                                       $linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title ));
-                               }
+                       # Get all the templates linked from the Mediawiki:Disambiguationspage
+                       $disPageObj = Title::makeTitleSafe( NS_MEDIAWIKI, 'disambiguationspage' );
+                       $res = $dbr->select(
+                               array( 'pagelinks', 'page' ),
+                               'pl_title',
+                               array(
+                                       'page_id = pl_from',
+                                       'pl_namespace' => NS_TEMPLATE,
+                                       'page_namespace' => $disPageObj->getNamespace(),
+                                       'page_title' => $disPageObj->getDBkey()
+                               ),
+                               __METHOD__
+                       );
+
+                       foreach ( $res as $row ) {
+                               $linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title ) );
+                       }
                }
                $set = $linkBatch->constructSet( 'tl', $dbr );
 
-               if( $set === false ) {
+               if ( $set === false ) {
                        # We must always return a valid SQL query, but this way
                        # the DB will always quickly return an empty result
                        $set = 'FALSE';
index 7564b00..c364f70 100644 (file)
@@ -122,10 +122,17 @@ class DoubleRedirectsPage extends QueryPage {
                // using the filter of reallyGetQueryInfo.
                if ( $result && !isset( $result->nsb ) ) {
                        $dbr = wfGetDB( DB_SLAVE );
-                       $qi = $this->reallyGetQueryInfo( $result->namespace,
-                                       $result->title );
-                       $res = $dbr->select( $qi['tables'], $qi['fields'],
-                                       $qi['conds'], __METHOD__ );
+                       $qi = $this->reallyGetQueryInfo(
+                               $result->namespace,
+                               $result->title
+                       );
+                       $res = $dbr->select(
+                               $qi['tables'],
+                               $qi['fields'],
+                               $qi['conds'],
+                               __METHOD__
+                       );
+
                        if ( $res ) {
                                $result = $dbr->fetchObject( $res );
                        }
@@ -166,7 +173,7 @@ class DoubleRedirectsPage extends QueryPage {
                $lang = $this->getLanguage();
                $arr = $lang->getArrow() . $lang->getDirMark();
 
-               return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
+               return ( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
        }
 
        protected function getGroupName() {
index ad06d5f..f297039 100644 (file)
@@ -35,7 +35,6 @@
  * @author Rob Church <robchur@gmail.com>
  */
 class SpecialEditWatchlist extends UnlistedSpecialPage {
-
        /**
         * Editing modes
         */
@@ -64,7 +63,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                $out = $this->getOutput();
 
                # Anons don't get a watchlist
-               if( $this->getUser()->isAnon() ) {
+               if ( $this->getUser()->isAnon() ) {
                        $out->setPageTitle( $this->msg( 'watchnologin' ) );
                        $llink = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Userlogin' ),
@@ -73,6 +72,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                array( 'returnto' => $this->getTitle()->getPrefixedText() )
                        );
                        $out->addHTML( $this->msg( 'watchlistanontext' )->rawParams( $llink )->parse() );
+
                        return;
                }
 
@@ -81,12 +81,12 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
 
                $this->outputHeader();
 
-               $out->addSubtitle( $this->msg( 'watchlistfor2', $this->getUser()->getName()
-                       )->rawParams( SpecialEditWatchlist::buildTools( null ) ) );
+               $out->addSubtitle( $this->msg( 'watchlistfor2', $this->getUser()->getName() )
+                       ->rawParams( SpecialEditWatchlist::buildTools( null ) ) );
 
                # B/C: $mode used to be waaay down the parameter list, and the first parameter
                # was $wgUser
-               if( $mode instanceof User ) {
+               if ( $mode instanceof User ) {
                        $args = func_get_args();
                        if ( count( $args ) >= 4 ) {
                                $mode = $args[3];
@@ -94,7 +94,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                }
                $mode = self::getMode( $this->getRequest(), $mode );
 
-               switch( $mode ) {
+               switch ( $mode ) {
                        case self::EDIT_CLEAR:
                                // The "Clear" link scared people too much.
                                // Pass on to the raw editor, from which it's very easy to clear.
@@ -102,7 +102,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        case self::EDIT_RAW:
                                $out->setPageTitle( $this->msg( 'watchlistedit-raw-title' ) );
                                $form = $this->getRawForm();
-                               if( $form->show() ) {
+                               if ( $form->show() ) {
                                        $out->addHTML( $this->successMessage );
                                        $out->addReturnTo( SpecialPage::getTitleFor( 'Watchlist' ) );
                                }
@@ -112,7 +112,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        default:
                                $out->setPageTitle( $this->msg( 'watchlistedit-normal-title' ) );
                                $form = $this->getNormalForm();
-                               if( $form->show() ) {
+                               if ( $form->show() ) {
                                        $out->addHTML( $this->successMessage );
                                        $out->addReturnTo( SpecialPage::getTitleFor( 'Watchlist' ) );
                                } elseif ( $this->toc !== false ) {
@@ -131,15 +131,17 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         */
        private function extractTitles( $list ) {
                $list = explode( "\n", trim( $list ) );
-               if( !is_array( $list ) ) {
+               if ( !is_array( $list ) ) {
                        return array();
                }
+
                $titles = array();
-               foreach( $list as $text ) {
+
+               foreach ( $list as $text ) {
                        $text = trim( $text );
-                       if( strlen( $text ) > 0 ) {
+                       if ( strlen( $text ) > 0 ) {
                                $title = Title::newFromText( $text );
-                               if( $title instanceof Title && $title->isWatchable() ) {
+                               if ( $title instanceof Title && $title->isWatchable() ) {
                                        $titles[] = $title;
                                }
                        }
@@ -148,9 +150,11 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                GenderCache::singleton()->doTitlesArray( $titles );
 
                $list = array();
-               foreach( $titles as $title ) {
+               /** @var Title $title */
+               foreach ( $titles as $title ) {
                        $list[] = $title->getPrefixedText();
                }
+
                return array_unique( $list );
        }
 
@@ -158,44 +162,45 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                $wanted = $this->extractTitles( $data['Titles'] );
                $current = $this->getWatchlist();
 
-               if( count( $wanted ) > 0 ) {
+               if ( count( $wanted ) > 0 ) {
                        $toWatch = array_diff( $wanted, $current );
                        $toUnwatch = array_diff( $current, $wanted );
                        $this->watchTitles( $toWatch );
                        $this->unwatchTitles( $toUnwatch );
                        $this->getUser()->invalidateCache();
 
-                       if( count( $toWatch ) > 0 || count( $toUnwatch ) > 0 ) {
+                       if ( count( $toWatch ) > 0 || count( $toUnwatch ) > 0 ) {
                                $this->successMessage = $this->msg( 'watchlistedit-raw-done' )->parse();
                        } else {
                                return false;
                        }
 
-                       if( count( $toWatch ) > 0 ) {
+                       if ( count( $toWatch ) > 0 ) {
                                $this->successMessage .= ' ' . $this->msg( 'watchlistedit-raw-added'
-                                       )->numParams( count( $toWatch ) )->parse();
+                               )->numParams( count( $toWatch ) )->parse();
                                $this->showTitles( $toWatch, $this->successMessage );
                        }
 
-                       if( count( $toUnwatch ) > 0 ) {
+                       if ( count( $toUnwatch ) > 0 ) {
                                $this->successMessage .= ' ' . $this->msg( 'watchlistedit-raw-removed'
-                                       )->numParams( count( $toUnwatch ) )->parse();
+                               )->numParams( count( $toUnwatch ) )->parse();
                                $this->showTitles( $toUnwatch, $this->successMessage );
                        }
                } else {
                        $this->clearWatchlist();
                        $this->getUser()->invalidateCache();
 
-                       if( count( $current ) > 0 ) {
+                       if ( count( $current ) > 0 ) {
                                $this->successMessage = $this->msg( 'watchlistedit-raw-done' )->parse();
                        } else {
                                return false;
                        }
 
-                       $this->successMessage .= ' ' . $this->msg( 'watchlistedit-raw-removed'
-                               )->numParams( count( $current ) )->parse();
+                       $this->successMessage .= ' ' . $this->msg( 'watchlistedit-raw-removed' )
+                               ->numParams( count( $current ) )->parse();
                        $this->showTitles( $current, $this->successMessage );
                }
+
                return true;
        }
 
@@ -212,29 +217,35 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                $talk = $this->msg( 'talkpagelinktext' )->escaped();
                // Do a batch existence check
                $batch = new LinkBatch();
-               foreach( $titles as $title ) {
-                       if( !$title instanceof Title ) {
+               foreach ( $titles as $title ) {
+                       if ( !$title instanceof Title ) {
                                $title = Title::newFromText( $title );
                        }
-                       if( $title instanceof Title ) {
+
+                       if ( $title instanceof Title ) {
                                $batch->addObj( $title );
                                $batch->addObj( $title->getTalkPage() );
                        }
                }
+
                $batch->execute();
+
                // Print out the list
                $output .= "<ul>\n";
-               foreach( $titles as $title ) {
-                       if( !$title instanceof Title ) {
+
+               foreach ( $titles as $title ) {
+                       if ( !$title instanceof Title ) {
                                $title = Title::newFromText( $title );
                        }
-                       if( $title instanceof Title ) {
+
+                       if ( $title instanceof Title ) {
                                $output .= "<li>"
                                        . Linker::link( $title )
                                        . ' (' . Linker::link( $title->getTalkPage(), $talk )
                                        . ")</li>\n";
                        }
                }
+
                $output .= "</ul>\n";
        }
 
@@ -247,6 +258,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
        private function getWatchlist() {
                $list = array();
                $dbr = wfGetDB( DB_MASTER );
+
                $res = $dbr->select(
                        'watchlist',
                        array(
@@ -256,10 +268,12 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        ),
                        __METHOD__
                );
-               if( $res->numRows() > 0 ) {
+
+               if ( $res->numRows() > 0 ) {
                        $titles = array();
                        foreach ( $res as $row ) {
                                $title = Title::makeTitleSafe( $row->wl_namespace, $row->wl_title );
+
                                if ( $this->checkTitle( $title, $row->wl_namespace, $row->wl_title )
                                        && !$title->isTalkPage()
                                ) {
@@ -270,11 +284,13 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
 
                        GenderCache::singleton()->doTitlesArray( $titles );
 
-                       foreach( $titles as $title ) {
+                       foreach ( $titles as $title ) {
                                $list[] = $title->getPrefixedText();
                        }
                }
+
                $this->cleanupWatchlist();
+
                return $list;
        }
 
@@ -297,6 +313,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                );
 
                $lb = new LinkBatch();
+
                foreach ( $res as $row ) {
                        $lb->add( $row->wl_namespace, $row->wl_title );
                        if ( !MWNamespace::isTalk( $row->wl_namespace ) ) {
@@ -305,6 +322,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                }
 
                $lb->execute();
+
                return $titles;
        }
 
@@ -324,12 +342,14 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                ) {
                        $title = false; // unrecoverable
                }
+
                if ( !$title
                        || $title->getNamespace() != $namespace
                        || $title->getDBkey() != $dbKey
                ) {
                        $this->badItems[] = array( $title, $namespace, $dbKey );
                }
+
                return (bool)$title;
        }
 
@@ -337,16 +357,17 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         * Attempts to clean up broken items
         */
        private function cleanupWatchlist() {
-               if( !count( $this->badItems ) ) {
+               if ( !count( $this->badItems ) ) {
                        return; //nothing to do
                }
+
                $dbw = wfGetDB( DB_MASTER );
                $user = $this->getUser();
+
                foreach ( $this->badItems as $row ) {
                        list( $title, $namespace, $dbKey ) = $row;
-                       wfDebug( "User {$user->getName()} has broken watchlist item ns($namespace):$dbKey, "
-                               . ( $title ? 'cleaning up' : 'deleting' ) . ".\n"
-                       );
+                       $action = $title ? 'cleaning up' : 'deleting';
+                       wfDebug( "User {$user->getName()} has broken watchlist item ns($namespace):$dbKey, $action.\n" );
 
                        $dbw->delete( 'watchlist',
                                array(
@@ -387,11 +408,13 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
        private function watchTitles( $titles ) {
                $dbw = wfGetDB( DB_MASTER );
                $rows = array();
-               foreach( $titles as $title ) {
-                       if( !$title instanceof Title ) {
+
+               foreach ( $titles as $title ) {
+                       if ( !$title instanceof Title ) {
                                $title = Title::newFromText( $title );
                        }
-                       if( $title instanceof Title ) {
+
+                       if ( $title instanceof Title ) {
                                $rows[] = array(
                                        'wl_user' => $this->getUser()->getId(),
                                        'wl_namespace' => MWNamespace::getSubject( $title->getNamespace() ),
@@ -406,6 +429,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                );
                        }
                }
+
                $dbw->insert( 'watchlist', $rows, __METHOD__, 'IGNORE' );
        }
 
@@ -419,11 +443,13 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         */
        private function unwatchTitles( $titles ) {
                $dbw = wfGetDB( DB_MASTER );
-               foreach( $titles as $title ) {
-                       if( !$title instanceof Title ) {
+
+               foreach ( $titles as $title ) {
+                       if ( !$title instanceof Title ) {
                                $title = Title::newFromText( $title );
                        }
-                       if( $title instanceof Title ) {
+
+                       if ( $title instanceof Title ) {
                                $dbw->delete(
                                        'watchlist',
                                        array(
@@ -433,6 +459,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                        ),
                                        __METHOD__
                                );
+
                                $dbw->delete(
                                        'watchlist',
                                        array(
@@ -442,6 +469,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                        ),
                                        __METHOD__
                                );
+
                                $page = WikiPage::factory( $title );
                                wfRunHooks( 'UnwatchArticleComplete', array( $this->getUser(), &$page ) );
                        }
@@ -451,15 +479,16 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
        public function submitNormal( $data ) {
                $removed = array();
 
-               foreach( $data as $titles ) {
+               foreach ( $data as $titles ) {
                        $this->unwatchTitles( $titles );
                        $removed = array_merge( $removed, $titles );
                }
 
-               if( count( $removed ) > 0 ) {
+               if ( count( $removed ) > 0 ) {
                        $this->successMessage = $this->msg( 'watchlistedit-normal-done'
-                               )->numParams( count( $removed ) )->parse();
+                       )->numParams( count( $removed ) )->parse();
                        $this->showTitles( $removed, $this->successMessage );
+
                        return true;
                } else {
                        return false;
@@ -477,7 +506,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                $fields = array();
                $count = 0;
 
-               foreach( $this->getWatchlistInfo() as $namespace => $pages ) {
+               foreach ( $this->getWatchlistInfo() as $namespace => $pages ) {
                        if ( $namespace >= 0 ) {
                                $fields['TitlesNs' . $namespace] = array(
                                        'class' => 'EditWatchlistCheckboxSeriesField',
@@ -486,8 +515,9 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                );
                        }
 
-                       foreach( array_keys( $pages ) as $dbkey ) {
+                       foreach ( array_keys( $pages ) as $dbkey ) {
                                $title = Title::makeTitleSafe( $namespace, $dbkey );
+
                                if ( $this->checkTitle( $title, $namespace, $dbkey ) ) {
                                        $text = $this->buildRemoveLine( $title );
                                        $fields['TitlesNs' . $namespace]['options'][$text] = $title->getPrefixedText();
@@ -500,17 +530,18 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                if ( count( $fields ) > 1 && $count > 30 ) {
                        $this->toc = Linker::tocIndent();
                        $tocLength = 0;
-                       foreach( $fields as $data ) {
 
+                       foreach ( $fields as $data ) {
                                # strip out the 'ns' prefix from the section name:
                                $ns = substr( $data['section'], 2 );
 
-                               $nsText = ($ns == NS_MAIN)
+                               $nsText = ( $ns == NS_MAIN )
                                        ? $this->msg( 'blanknamespace' )->escaped()
                                        : htmlspecialchars( $wgContLang->getFormattedNsText( $ns ) );
                                $this->toc .= Linker::tocLine( "editwatchlist-{$data['section']}", $nsText,
                                        $this->getLanguage()->formatNum( ++$tocLength ), 1 ) . Linker::tocLineEnd();
                        }
+
                        $this->toc = Linker::tocList( $this->toc );
                } else {
                        $this->toc = false;
@@ -524,6 +555,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                $form->setWrapperLegendMsg( 'watchlistedit-normal-legend' );
                $form->addHeaderText( $this->msg( 'watchlistedit-normal-explain' )->parse() );
                $form->setSubmitCallback( array( $this, 'submitNormal' ) );
+
                return $form;
        }
 
@@ -535,12 +567,15 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         */
        private function buildRemoveLine( $title ) {
                $link = Linker::link( $title );
-               if( $title->isRedirect() ) {
+
+               if ( $title->isRedirect() ) {
                        // Linker already makes class mw-redirect, so this is redundant
                        $link = '<span class="watchlistredir">' . $link . '</span>';
                }
+
                $tools[] = Linker::link( $title->getTalkPage(), $this->msg( 'talkpagelinktext' )->escaped() );
-               if( $title->exists() ) {
+
+               if ( $title->exists() ) {
                        $tools[] = Linker::linkKnown(
                                $title,
                                $this->msg( 'history_short' )->escaped(),
@@ -548,7 +583,8 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                array( 'action' => 'history' )
                        );
                }
-               if( $title->getNamespace() == NS_USER && !$title->isSubpage() ) {
+
+               if ( $title->getNamespace() == NS_USER && !$title->isSubpage() ) {
                        $tools[] = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Contributions', $title->getText() ),
                                $this->msg( 'contributions' )->escaped()
@@ -582,6 +618,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                $form->setWrapperLegendMsg( 'watchlistedit-raw-legend' );
                $form->addHeaderText( $this->msg( 'watchlistedit-raw-explain' )->parse() );
                $form->setSubmitCallback( array( $this, 'submitRaw' ) );
+
                return $form;
        }
 
@@ -595,19 +632,17 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         */
        public static function getMode( $request, $par ) {
                $mode = strtolower( $request->getVal( 'action', $par ) );
-               switch( $mode ) {
+
+               switch ( $mode ) {
                        case 'clear':
                        case self::EDIT_CLEAR:
                                return self::EDIT_CLEAR;
-
                        case 'raw':
                        case self::EDIT_RAW:
                                return self::EDIT_RAW;
-
                        case 'edit':
                        case self::EDIT_NORMAL:
                                return self::EDIT_NORMAL;
-
                        default:
                                return false;
                }
@@ -629,21 +664,26 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        'edit' => array( 'EditWatchlist', false ),
                        'raw' => array( 'EditWatchlist', 'raw' ),
                );
-               foreach( $modes as $mode => $arr ) {
+
+               foreach ( $modes as $mode => $arr ) {
                        // can use messages 'watchlisttools-view', 'watchlisttools-edit', 'watchlisttools-raw'
                        $tools[] = Linker::linkKnown(
                                SpecialPage::getTitleFor( $arr[0], $arr[1] ),
                                wfMessage( "watchlisttools-{$mode}" )->escaped()
                        );
                }
-               return Html::rawElement( 'span',
-                                       array( 'class' => 'mw-watchlist-toollinks' ),
-                                       wfMessage( 'parentheses', $wgLang->pipeList( $tools ) )->text() );
+
+               return Html::rawElement(
+                       'span',
+                       array( 'class' => 'mw-watchlist-toollinks' ),
+                       wfMessage( 'parentheses', $wgLang->pipeList( $tools ) )->text()
+               );
        }
 }
 
 # B/C since 1.18
-class WatchlistEditor extends SpecialEditWatchlist {}
+class WatchlistEditor extends SpecialEditWatchlist {
+}
 
 /**
  * Extend HTMLForm purely so we can have a more sane way of getting the section headers
@@ -651,10 +691,12 @@ class WatchlistEditor extends SpecialEditWatchlist {}
 class EditWatchlistNormalHTMLForm extends HTMLForm {
        public function getLegend( $namespace ) {
                $namespace = substr( $namespace, 2 );
+
                return $namespace == NS_MAIN
                        ? $this->msg( 'blanknamespace' )->escaped()
                        : htmlspecialchars( $this->getContext()->getLanguage()->getFormattedNsText( $namespace ) );
        }
+
        public function getBody() {
                return $this->displaySection( $this->mFieldTree, '', 'editwatchlist-' );
        }
index 3607be9..d037d55 100644 (file)
 class SpecialEmailUser extends UnlistedSpecialPage {
        protected $mTarget;
 
+       /**
+        * @var User|string $mTargetObj
+        */
+       protected $mTargetObj;
+
        public function __construct() {
                parent::__construct( 'Emailuser' );
        }
 
        public function getDescription() {
                $target = self::getTarget( $this->mTarget );
-               if( !$target instanceof User ) {
+               if ( !$target instanceof User ) {
                        return $this->msg( 'emailuser-title-notarget' )->text();
                }
 
@@ -106,7 +111,11 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                $this->outputHeader();
 
                // error out if sending user cannot do this
-               $error = self::getPermissionsError( $this->getUser(), $this->getRequest()->getVal( 'wpEditToken' ) );
+               $error = self::getPermissionsError(
+                       $this->getUser(),
+                       $this->getRequest()->getVal( 'wpEditToken' )
+               );
+
                switch ( $error ) {
                        case null:
                                # Wahey!
@@ -127,12 +136,13 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                }
                // Got a valid target user name? Else ask for one.
                $ret = self::getTarget( $this->mTarget );
-               if( !$ret instanceof User ) {
-                       if( $this->mTarget != '' ) {
+               if ( !$ret instanceof User ) {
+                       if ( $this->mTarget != '' ) {
                                $ret = ( $ret == 'notarget' ) ? 'emailnotarget' : ( $ret . 'text' );
                                $out->wrapWikiMsg( "<p class='error'>$1</p>", $ret );
                        }
                        $out->addHTML( $this->userForm( $this->mTarget ) );
+
                        return false;
                }
 
@@ -147,13 +157,13 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                $form->setWrapperLegendMsg( 'email-legend' );
                $form->loadData();
 
-               if( !wfRunHooks( 'EmailUserForm', array( &$form ) ) ) {
+               if ( !wfRunHooks( 'EmailUserForm', array( &$form ) ) ) {
                        return false;
                }
 
                $result = $form->show();
 
-               if( $result === true || ( $result instanceof Status && $result->isGood() ) ) {
+               if ( $result === true || ( $result instanceof Status && $result->isGood() ) ) {
                        $out->setPageTitle( $this->msg( 'emailsent' ) );
                        $out->addWikiMsg( 'emailsenttext' );
                        $out->returnToMain( false, $this->mTargetObj->getUserPage() );
@@ -169,18 +179,22 @@ class SpecialEmailUser extends UnlistedSpecialPage {
        public static function getTarget( $target ) {
                if ( $target == '' ) {
                        wfDebug( "Target is empty.\n" );
+
                        return 'notarget';
                }
 
                $nu = User::newFromName( $target );
-               if( !$nu instanceof User || !$nu->getId() ) {
+               if ( !$nu instanceof User || !$nu->getId() ) {
                        wfDebug( "Target is invalid user.\n" );
+
                        return 'notarget';
                } elseif ( !$nu->isEmailConfirmed() ) {
                        wfDebug( "User has no valid email.\n" );
+
                        return 'noemail';
                } elseif ( !$nu->canReceiveEmail() ) {
                        wfDebug( "User does not allow user emails.\n" );
+
                        return 'nowikiemail';
                }
 
@@ -196,31 +210,36 @@ class SpecialEmailUser extends UnlistedSpecialPage {
         */
        public static function getPermissionsError( $user, $editToken ) {
                global $wgEnableEmail, $wgEnableUserEmail;
-               if( !$wgEnableEmail || !$wgEnableUserEmail ) {
+
+               if ( !$wgEnableEmail || !$wgEnableUserEmail ) {
                        return 'usermaildisabled';
                }
 
-               if( !$user->isAllowed( 'sendemail' ) ) {
+               if ( !$user->isAllowed( 'sendemail' ) ) {
                        return 'badaccess';
                }
 
-               if( !$user->isEmailConfirmed() ) {
+               if ( !$user->isEmailConfirmed() ) {
                        return 'mailnologin';
                }
 
-               if( $user->isBlockedFromEmailuser() ) {
+               if ( $user->isBlockedFromEmailuser() ) {
                        wfDebug( "User is blocked from sending e-mail.\n" );
+
                        return "blockedemailuser";
                }
 
-               if( $user->pingLimiter( 'emailuser' ) ) {
+               if ( $user->pingLimiter( 'emailuser' ) ) {
                        wfDebug( "Ping limiter triggered.\n" );
+
                        return 'actionthrottledtext';
                }
 
                $hookErr = false;
+
                wfRunHooks( 'UserCanSendEmail', array( &$user, &$hookErr ) );
                wfRunHooks( 'EmailUserPermissionsErrors', array( $user, $editToken, &$hookErr ) );
+
                if ( $hookErr ) {
                        return $hookErr;
                }
@@ -236,14 +255,25 @@ class SpecialEmailUser extends UnlistedSpecialPage {
         */
        protected function userForm( $name ) {
                global $wgScript;
-               $string = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'askusername' ) ) .
+               $string = Xml::openElement(
+                       'form',
+                       array( 'method' => 'get', 'action' => $wgScript, 'id' => 'askusername' )
+               ) .
                        Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
                        Xml::openElement( 'fieldset' ) .
                        Html::rawElement( 'legend', null, $this->msg( 'emailtarget' )->parse() ) .
-                       Xml::inputLabel( $this->msg( 'emailusername' )->text(), 'target', 'emailusertarget', 30, $name ) . ' ' .
+                       Xml::inputLabel(
+                               $this->msg( 'emailusername' )->text(),
+                               'target',
+                               'emailusertarget',
+                               30,
+                               $name
+                       ) .
+                       ' ' .
                        Xml::submitButton( $this->msg( 'emailusernamesubmit' )->text() ) .
                        Xml::closeElement( 'fieldset' ) .
                        Xml::closeElement( 'form' ) . "\n";
+
                return $string;
        }
 
@@ -273,9 +303,10 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                global $wgUserEmailUseReplyTo;
 
                $target = self::getTarget( $data['Target'] );
-               if( !$target instanceof User ) {
+               if ( !$target instanceof User ) {
                        return $context->msg( $target . 'text' )->parseAsBlock();
                }
+
                $to = new MailAddress( $target );
                $from = new MailAddress( $context->getUser() );
                $subject = $data['Subject'];
@@ -287,11 +318,11 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        $from->name, $to->name )->inContentLanguage()->text();
 
                $error = '';
-               if( !wfRunHooks( 'EmailUser', array( &$to, &$from, &$subject, &$text, &$error ) ) ) {
+               if ( !wfRunHooks( 'EmailUser', array( &$to, &$from, &$subject, &$text, &$error ) ) ) {
                        return $error;
                }
 
-               if( $wgUserEmailUseReplyTo ) {
+               if ( $wgUserEmailUseReplyTo ) {
                        // Put the generic wiki autogenerated address in the From:
                        // header and reserve the user for Reply-To.
                        //
@@ -299,6 +330,7 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        // wiki-borne mails from direct mails and protects against
                        // SPF and bounce problems with some mailers (see below).
                        global $wgPasswordSender, $wgPasswordSenderName;
+
                        $mailFrom = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
                        $replyTo = $from;
                } else {
@@ -321,7 +353,7 @@ class SpecialEmailUser extends UnlistedSpecialPage {
 
                $status = UserMailer::send( $to, $mailFrom, $subject, $text, $replyTo );
 
-               if( !$status->isGood() ) {
+               if ( !$status->isGood() ) {
                        return $status;
                } else {
                        // if the user requested a copy of this mail, do this now,
@@ -336,6 +368,7 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        }
 
                        wfRunHooks( 'EmailUserComplete', array( $to, $from, $subject, $text ) );
+
                        return $status;
                }
        }
index ef86e8e..61ed34d 100644 (file)
@@ -29,7 +29,6 @@
  * @ingroup SpecialPage
  */
 class SpecialExport extends SpecialPage {
-
        private $curonly, $doExport, $pageLinkDepth, $templates;
        private $images;
 
@@ -75,8 +74,7 @@ class SpecialExport extends SpecialPage {
                                        }
                                }
                        }
-               }
-               elseif( $request->getCheck( 'addns' ) && $wgExportFromNamespaces ) {
+               } elseif ( $request->getCheck( 'addns' ) && $wgExportFromNamespaces ) {
                        $page = $request->getText( 'pages' );
                        $nsindex = $request->getText( 'nsindex', '' );
 
@@ -89,8 +87,7 @@ class SpecialExport extends SpecialPage {
                                        $page .= "\n" . implode( "\n", $nspages );
                                }
                        }
-               }
-               elseif( $request->getCheck( 'exportall' ) && $wgExportAllowAll ) {
+               } elseif ( $request->getCheck( 'exportall' ) && $wgExportAllowAll ) {
                        $this->doExport = true;
                        $exportall = true;
 
@@ -100,13 +97,12 @@ class SpecialExport extends SpecialPage {
                        doExport(...) further down) */
                        $page = '';
                        $history = '';
-               }
-               elseif( $request->wasPosted() && $par == '' ) {
+               } elseif ( $request->wasPosted() && $par == '' ) {
                        $page = $request->getText( 'pages' );
                        $this->curonly = $request->getCheck( 'curonly' );
                        $rawOffset = $request->getVal( 'offset' );
 
-                       if( $rawOffset ) {
+                       if ( $rawOffset ) {
                                $offset = wfTimestamp( TS_MW, $rawOffset );
                        } else {
                                $offset = null;
@@ -127,15 +123,17 @@ class SpecialExport extends SpecialPage {
                                if ( $limit > 0 && ( $wgExportMaxHistory == 0 || $limit < $wgExportMaxHistory ) ) {
                                        $history['limit'] = $limit;
                                }
+
                                if ( !is_null( $offset ) ) {
                                        $history['offset'] = $offset;
                                }
+
                                if ( strtolower( $dir ) == 'desc' ) {
                                        $history['dir'] = 'desc';
                                }
                        }
 
-                       if( $page != '' ) {
+                       if ( $page != '' ) {
                                $this->doExport = true;
                        }
                } else {
@@ -143,18 +141,18 @@ class SpecialExport extends SpecialPage {
                        $page = $request->getText( 'pages', $par );
                        $historyCheck = $request->getCheck( 'history' );
 
-                       if( $historyCheck ) {
+                       if ( $historyCheck ) {
                                $history = WikiExporter::FULL;
                        } else {
                                $history = WikiExporter::CURRENT;
                        }
 
-                       if( $page != '' ) {
+                       if ( $page != '' ) {
                                $this->doExport = true;
                        }
                }
 
-               if( !$wgExportAllowHistory ) {
+               if ( !$wgExportAllowHistory ) {
                        // Override
                        $history = WikiExporter::CURRENT;
                }
@@ -172,7 +170,7 @@ class SpecialExport extends SpecialPage {
                        wfResetOutputBuffers();
                        $request->response()->header( "Content-type: application/xml; charset=utf-8" );
 
-                       if( $request->getCheck( 'wpDownload' ) ) {
+                       if ( $request->getCheck( 'wpDownload' ) ) {
                                // Provide a sane filename suggestion
                                $filename = urlencode( $wgSitename . '-' . wfTimestampNow() . '.xml' );
                                $request->response()->header( "Content-disposition: attachment;filename={$filename}" );
@@ -188,8 +186,16 @@ class SpecialExport extends SpecialPage {
 
                $form = Xml::openElement( 'form', array( 'method' => 'post',
                        'action' => $this->getTitle()->getLocalURL( 'action=submit' ) ) );
-               $form .= Xml::inputLabel( $this->msg( 'export-addcattext' )->text(), 'catname', 'catname', 40 ) . '&#160;';
-               $form .= Xml::submitButton( $this->msg( 'export-addcat' )->text(), array( 'name' => 'addcat' ) ) . '<br />';
+               $form .= Xml::inputLabel(
+                       $this->msg( 'export-addcattext' )->text(),
+                       'catname',
+                       'catname',
+                       40
+               ) . '&#160;';
+               $form .= Xml::submitButton(
+                       $this->msg( 'export-addcat' )->text(),
+                       array( 'name' => 'addcat' )
+               ) . '<br />';
 
                if ( $wgExportFromNamespaces ) {
                        $form .= Html::namespaceSelector(
@@ -197,12 +203,15 @@ class SpecialExport extends SpecialPage {
                                        'selected' => $nsindex,
                                        'label' => $this->msg( 'export-addnstext' )->text()
                                ), array(
-                                       'name'  => 'nsindex',
-                                       'id'    => 'namespace',
+                                       'name' => 'nsindex',
+                                       'id' => 'namespace',
                                        'class' => 'namespaceselector',
                                )
                        ) . '&#160;';
-                       $form .= Xml::submitButton( $this->msg( 'export-addns' )->text(), array( 'name' => 'addns' ) ) . '<br />';
+                       $form .= Xml::submitButton(
+                               $this->msg( 'export-addns' )->text(),
+                               array( 'name' => 'addns' )
+                       ) . '<br />';
                }
 
                if ( $wgExportAllowAll ) {
@@ -214,10 +223,15 @@ class SpecialExport extends SpecialPage {
                        ) . '<br />';
                }
 
-               $form .= Xml::element( 'textarea', array( 'name' => 'pages', 'cols' => 40, 'rows' => 10 ), $page, false );
+               $form .= Xml::element(
+                       'textarea',
+                       array( 'name' => 'pages', 'cols' => 40, 'rows' => 10 ),
+                       $page,
+                       false
+               );
                $form .= '<br />';
 
-               if( $wgExportAllowHistory ) {
+               if ( $wgExportAllowHistory ) {
                        $form .= Xml::checkLabel(
                                $this->msg( 'exportcuronly' )->text(),
                                'curonly',
@@ -235,9 +249,16 @@ class SpecialExport extends SpecialPage {
                        $request->wasPosted() ? $request->getCheck( 'templates' ) : false
                ) . '<br />';
 
-               if( $wgExportMaxLinkDepth || $this->userCanOverrideExportDepth() ) {
-                       $form .= Xml::inputLabel( $this->msg( 'export-pagelinks' )->text(), 'pagelink-depth', 'pagelink-depth', 20, 0 ) . '<br />';
+               if ( $wgExportMaxLinkDepth || $this->userCanOverrideExportDepth() ) {
+                       $form .= Xml::inputLabel(
+                               $this->msg( 'export-pagelinks' )->text(),
+                               'pagelink-depth',
+                               'pagelink-depth',
+                               20,
+                               0
+                       ) . '<br />';
                }
+
                // Enable this when we can do something useful exporting/importing image information. :)
                //$form .= Xml::checkLabel( $this->msg( 'export-images' )->text(), 'images', 'wpExportImages', false ) . '<br />';
                $form .= Xml::checkLabel(
@@ -256,7 +277,10 @@ class SpecialExport extends SpecialPage {
                        ) . '<br />';
                }
 
-               $form .= Xml::submitButton( $this->msg( 'export-submit' )->text(), Linker::tooltipAndAccesskeyAttribs( 'export' ) );
+               $form .= Xml::submitButton(
+                       $this->msg( 'export-submit' )->text(),
+                       Linker::tooltipAndAccesskeyAttribs( 'export' )
+               );
                $form .= Xml::closeElement( 'form' );
 
                $out->addHTML( $form );
@@ -288,10 +312,10 @@ class SpecialExport extends SpecialPage {
                        $pageSet = array(); // Inverted index of all pages to look up
 
                        // Split up and normalize input
-                       foreach( explode( "\n", $page ) as $pageName ) {
+                       foreach ( explode( "\n", $page ) as $pageName ) {
                                $pageName = trim( $pageName );
                                $title = Title::newFromText( $pageName );
-                               if( $title && $title->getInterwiki() == '' && $title->getText() !== '' ) {
+                               if ( $title && $title->getInterwiki() == '' && $title->getText() !== '' ) {
                                        // Only record each page once!
                                        $pageSet[$title->getPrefixedText()] = true;
                                }
@@ -301,25 +325,23 @@ class SpecialExport extends SpecialPage {
                        $inputPages = array_keys( $pageSet );
 
                        // Look up any linked pages if asked...
-                       if( $this->templates ) {
+                       if ( $this->templates ) {
                                $pageSet = $this->getTemplates( $inputPages, $pageSet );
                        }
                        $linkDepth = $this->pageLinkDepth;
-                       if( $linkDepth ) {
+                       if ( $linkDepth ) {
                                $pageSet = $this->getPageLinks( $inputPages, $pageSet, $linkDepth );
                        }
 
-                       /*
-                        // Enable this when we can do something useful exporting/importing image information. :)
-                        if( $this->images ) ) {
-                        $pageSet = $this->getImages( $inputPages, $pageSet );
-                        }
-                       */
+                       // Enable this when we can do something useful exporting/importing image information.
+                       // if( $this->images ) ) {
+                       // $pageSet = $this->getImages( $inputPages, $pageSet );
+                       // }
 
                        $pages = array_keys( $pageSet );
 
                        // Normalize titles to the same format and remove dupes, see bug 17374
-                       foreach( $pages as $k => $v ) {
+                       foreach ( $pages as $k => $v ) {
                                $pages[$k] = str_replace( " ", "_", $v );
                        }
 
@@ -327,7 +349,7 @@ class SpecialExport extends SpecialPage {
                }
 
                /* Ok, let's get to it... */
-               if( $history == WikiExporter::CURRENT ) {
+               if ( $history == WikiExporter::CURRENT ) {
                        $lb = false;
                        $db = wfGetDB( DB_SLAVE );
                        $buffer = WikiExporter::BUFFER;
@@ -350,26 +372,17 @@ class SpecialExport extends SpecialPage {
                if ( $exportall ) {
                        $exporter->allPages();
                } else {
-                       foreach( $pages as $page ) {
-                       /*
-                        if( $wgExportMaxHistory && !$this->curonly ) {
-                        $title = Title::newFromText( $page );
-                        if( $title ) {
-                        $count = Revision::countByTitle( $db, $title );
-                        if( $count > $wgExportMaxHistory ) {
-                        wfDebug( __FUNCTION__ .
-                        ": Skipped $page, $count revisions too big\n" );
-                        continue;
-                        }
-                        }
-                        }*/
-                       #Bug 8824: Only export pages the user can read
+                       foreach ( $pages as $page ) {
+                               #Bug 8824: Only export pages the user can read
                                $title = Title::newFromText( $page );
-                               if( is_null( $title ) ) {
-                                       continue; #TODO: perhaps output an <error> tag or something.
+                               if ( is_null( $title ) ) {
+                                       // @todo Perhaps output an <error> tag or something.
+                                       continue;
                                }
-                               if( !$title->userCan( 'read', $this->getUser() ) ) {
-                                       continue; #TODO: perhaps output an <error> tag or something.
+
+                               if ( !$title->userCan( 'read', $this->getUser() ) ) {
+                                       // @todo Perhaps output an <error> tag or something.
+                                       continue;
                                }
 
                                $exporter->pageByTitle( $title );
@@ -378,7 +391,7 @@ class SpecialExport extends SpecialPage {
 
                $exporter->closeStream();
 
-               if( $lb ) {
+               if ( $lb ) {
                        $lb->closeAll();
                }
        }
@@ -412,6 +425,7 @@ class SpecialExport extends SpecialPage {
 
                        $pages[] = $n;
                }
+
                return $pages;
        }
 
@@ -443,6 +457,7 @@ class SpecialExport extends SpecialPage {
 
                        $pages[] = $n;
                }
+
                return $pages;
        }
 
@@ -468,12 +483,12 @@ class SpecialExport extends SpecialPage {
        private function validateLinkDepth( $depth ) {
                global $wgExportMaxLinkDepth;
 
-               if( $depth < 0 ) {
+               if ( $depth < 0 ) {
                        return 0;
                }
 
                if ( !$this->userCanOverrideExportDepth() ) {
-                       if( $depth > $wgExportMaxLinkDepth ) {
+                       if ( $depth > $wgExportMaxLinkDepth ) {
                                return $wgExportMaxLinkDepth;
                        }
                }
@@ -483,6 +498,7 @@ class SpecialExport extends SpecialPage {
                 * crazy-big export from being done by someone setting the depth
                 * number too high. In other words, last resort safety net.
                 */
+
                return intval( min( $depth, 5 ) );
        }
 
@@ -494,7 +510,7 @@ class SpecialExport extends SpecialPage {
         * @return array
         */
        private function getPageLinks( $inputPages, $pageSet, $depth ) {
-               for( ; $depth > 0; --$depth ) {
+               for ( ; $depth > 0; --$depth ) {
                        $pageSet = $this->getLinks(
                                $inputPages, $pageSet, 'pagelinks',
                                array( 'namespace' => 'pl_namespace', 'title' => 'pl_title' ),
@@ -536,10 +552,10 @@ class SpecialExport extends SpecialPage {
        private function getLinks( $inputPages, $pageSet, $table, $fields, $join ) {
                $dbr = wfGetDB( DB_SLAVE );
 
-               foreach( $inputPages as $page ) {
+               foreach ( $inputPages as $page ) {
                        $title = Title::newFromText( $page );
 
-                       if( $title ) {
+                       if ( $title ) {
                                $pageSet[$title->getPrefixedText()] = true;
                                /// @todo FIXME: May or may not be more efficient to batch these
                                ///        by namespace when given multiple input pages.
@@ -556,7 +572,7 @@ class SpecialExport extends SpecialPage {
                                        __METHOD__
                                );
 
-                               foreach( $result as $row ) {
+                               foreach ( $result as $row ) {
                                        $template = Title::makeTitle( $row->namespace, $row->title );
                                        $pageSet[$template->getPrefixedText()] = true;
                                }
index 41b1d4b..47a4d75 100644 (file)
@@ -28,7 +28,6 @@
  * @author Martin Drashkov
  */
 class FewestrevisionsPage extends QueryPage {
-
        function __construct( $name = 'Fewestrevisions' ) {
                parent::__construct( $name );
        }
@@ -44,19 +43,24 @@ class FewestrevisionsPage extends QueryPage {
        function getQueryInfo() {
                return array(
                        'tables' => array( 'revision', 'page' ),
-                       'fields' => array( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'COUNT(*)',
-                                       'redirect' => 'page_is_redirect' ),
-                       'conds' => array( 'page_namespace' => MWNamespace::getContentNamespaces(),
-                                       'page_id = rev_page' ),
-                       'options' => array( 'HAVING' => 'COUNT(*) > 1',
-                       // ^^^ This was probably here to weed out redirects.
-                       // Since we mark them as such now, it might be
-                       // useful to remove this. People _do_ create pages
-                       // and never revise them, they aren't necessarily
-                       // redirects.
-                       'GROUP BY' => array( 'page_namespace', 'page_title', 'page_is_redirect' ) )
+                       'fields' => array(
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'COUNT(*)',
+                               'redirect' => 'page_is_redirect'
+                       ),
+                       'conds' => array(
+                               'page_namespace' => MWNamespace::getContentNamespaces(),
+                               'page_id = rev_page' ),
+                       'options' => array(
+                               'HAVING' => 'COUNT(*) > 1',
+                               // ^^^ This was probably here to weed out redirects.
+                               // Since we mark them as such now, it might be
+                               // useful to remove this. People _do_ create pages
+                               // and never revise them, they aren't necessarily
+                               // redirects.
+                               'GROUP BY' => array( 'page_namespace', 'page_title', 'page_is_redirect' )
+                       )
                );
        }
 
@@ -73,9 +77,16 @@ class FewestrevisionsPage extends QueryPage {
                global $wgContLang;
 
                $nt = Title::makeTitleSafe( $result->namespace, $result->title );
-               if( !$nt ) {
-                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                               Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+               if ( !$nt ) {
+                       return Html::element(
+                               'span',
+                               array( 'class' => 'mw-invalidtitle' ),
+                               Linker::getInvalidTitleDescription(
+                                       $this->getContext(),
+                                       $result->namespace,
+                                       $result->title
+                               )
+                       );
                }
 
                $text = htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) );
index 71f19fa..4c6593b 100644 (file)
@@ -101,11 +101,11 @@ class FileDuplicateSearchPage extends QueryPage {
                $this->setHeaders();
                $this->outputHeader();
 
-               $this->filename = isset( $par ) ?  $par : $this->getRequest()->getText( 'filename' );
+               $this->filename = isset( $par ) ? $par : $this->getRequest()->getText( 'filename' );
                $this->file = null;
                $this->hash = '';
                $title = Title::newFromText( $this->filename, NS_FILE );
-               if( $title && $title->getText() != '' ) {
+               if ( $title && $title->getText() != '' ) {
                        $this->file = wfFindFile( $title );
                }
 
@@ -113,37 +113,46 @@ class FileDuplicateSearchPage extends QueryPage {
 
                # Create the input form
                $out->addHTML(
-                       Html::openElement( 'form', array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript ) ) . "\n" .
-                       Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
-                       Html::openElement( 'fieldset' ) . "\n" .
-                       Html::element( 'legend', null, $this->msg( 'fileduplicatesearch-legend' )->text() ) . "\n" .
-                       Xml::inputLabel( $this->msg( 'fileduplicatesearch-filename' )->text(), 'filename', 'filename', 50, $this->filename ) . "\n" .
-                       Xml::submitButton( $this->msg( 'fileduplicatesearch-submit' )->text() ) . "\n" .
-                       Html::closeElement( 'fieldset' ) . "\n" .
-                       Html::closeElement( 'form' )
+                       Html::openElement(
+                               'form',
+                               array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript )
+                       ) . "\n" .
+                               Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
+                               Html::openElement( 'fieldset' ) . "\n" .
+                               Html::element( 'legend', null, $this->msg( 'fileduplicatesearch-legend' )->text() ) . "\n" .
+                               Xml::inputLabel(
+                                       $this->msg( 'fileduplicatesearch-filename' )->text(),
+                                       'filename',
+                                       'filename',
+                                       50,
+                                       $this->filename
+                               ) . "\n" .
+                               Xml::submitButton( $this->msg( 'fileduplicatesearch-submit' )->text() ) . "\n" .
+                               Html::closeElement( 'fieldset' ) . "\n" .
+                               Html::closeElement( 'form' )
                );
 
-               if( $this->file ) {
+               if ( $this->file ) {
                        $this->hash = $this->file->getSha1();
-               } elseif( $this->filename !== '' ) {
+               } elseif ( $this->filename !== '' ) {
                        $out->wrapWikiMsg(
                                "<p class='mw-fileduplicatesearch-noresults'>\n$1\n</p>",
                                array( 'fileduplicatesearch-noresults', wfEscapeWikiText( $this->filename ) )
                        );
                }
 
-               if( $this->hash != '' ) {
+               if ( $this->hash != '' ) {
                        # Show a thumbnail of the file
                        $img = $this->file;
                        if ( $img ) {
                                $thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) );
-                               if( $thumb ) {
+                               if ( $thumb ) {
                                        $out->addHTML( '<div id="mw-fileduplicatesearch-icon">' .
                                                $thumb->toHtml( array( 'desc-link' => false ) ) . '<br />' .
                                                $this->msg( 'fileduplicatesearch-info' )->numParams(
                                                        $img->getWidth(), $img->getHeight() )->params(
-                                                       $this->getLanguage()->formatSize( $img->getSize() ),
-                                                       $img->getMimeType() )->parseAsBlock() .
+                                                               $this->getLanguage()->formatSize( $img->getSize() ),
+                                                               $img->getMimeType() )->parseAsBlock() .
                                                '</div>' );
                                }
                        }
@@ -152,7 +161,7 @@ class FileDuplicateSearchPage extends QueryPage {
                        $numRows = count( $dupes );
 
                        # Show a short summary
-                       if( $numRows == 1 ) {
+                       if ( $numRows == 1 ) {
                                $out->wrapWikiMsg(
                                        "<p class='mw-fileduplicatesearch-result-1'>\n$1\n</p>",
                                        array( 'fileduplicatesearch-result-1', wfEscapeWikiText( $this->filename ) )
@@ -172,14 +181,16 @@ class FileDuplicateSearchPage extends QueryPage {
 
        function doBatchLookups( $list ) {
                $batch = new LinkBatch();
-               foreach( $list as $file ) {
+               /** @var File $file */
+               foreach ( $list as $file ) {
                        $batch->addObj( $file->getTitle() );
-                       if( $file->isLocal() ) {
+                       if ( $file->isLocal() ) {
                                $userName = $file->getUser( 'text' );
                                $batch->add( NS_USER, $userName );
                                $batch->add( NS_USER_TALK, $userName );
                        }
                }
+
                $batch->execute();
        }
 
index dc56b5a..d4b0285 100644 (file)
@@ -27,7 +27,6 @@
  * @ingroup SpecialPage
  */
 class SpecialFilepath extends SpecialPage {
-
        function __construct() {
                parent::__construct( 'Filepath' );
        }
@@ -55,6 +54,7 @@ class SpecialFilepath extends SpecialPage {
                                // If a width is requested...
                                if ( $width != -1 ) {
                                        $mto = $file->transform( array( 'width' => $width, 'height' => $height ) );
+
                                        // ... and we can
                                        if ( $mto && !$mto->isError() ) {
                                                // ... change the URL to point to a thumbnail.
@@ -76,14 +76,23 @@ class SpecialFilepath extends SpecialPage {
                global $wgScript;
 
                $this->getOutput()->addHTML(
-                       Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'specialfilepath' ) ) .
-                       Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', null, $this->msg( 'filepath' )->text() ) .
-                       Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
-                       Xml::inputLabel( $this->msg( 'filepath-page' )->text(), 'file', 'file', 25, is_object( $title ) ? $title->getText() : '' ) . ' ' .
-                       Xml::submitButton( $this->msg( 'filepath-submit' )->text() ) . "\n" .
-                       Html::closeElement( 'fieldset' ) .
-                       Html::closeElement( 'form' )
+                       Html::openElement(
+                               'form',
+                               array( 'method' => 'get', 'action' => $wgScript, 'id' => 'specialfilepath' )
+                       ) .
+                               Html::openElement( 'fieldset' ) .
+                               Html::element( 'legend', null, $this->msg( 'filepath' )->text() ) .
+                               Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
+                               Xml::inputLabel(
+                                       $this->msg( 'filepath-page' )->text(),
+                                       'file',
+                                       'file',
+                                       25,
+                                       is_object( $title ) ? $title->getText() : ''
+                               ) . ' ' .
+                               Xml::submitButton( $this->msg( 'filepath-submit' )->text() ) . "\n" .
+                               Html::closeElement( 'fieldset' ) .
+                               Html::closeElement( 'form' )
                );
        }
 
index 68b0024..0d54bb3 100644 (file)
@@ -30,7 +30,6 @@
  * @ingroup SpecialPage
  */
 class SpecialImport extends SpecialPage {
-
        private $interwiki = false;
        private $namespace;
        private $rootpage = '';
@@ -108,13 +107,13 @@ class SpecialImport extends SpecialPage {
                        $source = Status::newFatal( 'import-token-mismatch' );
                } elseif ( $sourceName == 'upload' ) {
                        $isUpload = true;
-                       if( $user->isAllowed( 'importupload' ) ) {
+                       if ( $user->isAllowed( 'importupload' ) ) {
                                $source = ImportStreamSource::newFromUpload( "xmlimport" );
                        } else {
                                throw new PermissionsError( 'importupload' );
                        }
                } elseif ( $sourceName == "interwiki" ) {
-                       if( !$user->isAllowed( 'import' ) ) {
+                       if ( !$user->isAllowed( 'import' ) ) {
                                throw new PermissionsError( 'import' );
                        }
                        $this->interwiki = $request->getVal( 'interwiki' );
@@ -136,24 +135,40 @@ class SpecialImport extends SpecialPage {
                }
 
                $out = $this->getOutput();
-               if( !$source->isGood() ) {
-                       $out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'importfailed', $source->getWikiText() ) );
+               if ( !$source->isGood() ) {
+                       $out->wrapWikiMsg(
+                               "<p class=\"error\">\n$1\n</p>",
+                               array( 'importfailed', $source->getWikiText() )
+                       );
                } else {
                        $importer = new WikiImporter( $source->value );
-                       if( !is_null( $this->namespace ) ) {
+                       if ( !is_null( $this->namespace ) ) {
                                $importer->setTargetNamespace( $this->namespace );
                        }
-                       if( !is_null( $this->rootpage ) ) {
+                       if ( !is_null( $this->rootpage ) ) {
                                $statusRootPage = $importer->setTargetRootPage( $this->rootpage );
-                               if( !$statusRootPage->isGood() ) {
-                                       $out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'import-options-wrong', $statusRootPage->getWikiText(), count( $statusRootPage->getErrorsArray() ) ) );
+                               if ( !$statusRootPage->isGood() ) {
+                                       $out->wrapWikiMsg(
+                                               "<p class=\"error\">\n$1\n</p>",
+                                               array(
+                                                       'import-options-wrong',
+                                                       $statusRootPage->getWikiText(),
+                                                       count( $statusRootPage->getErrorsArray() )
+                                               )
+                                       );
+
                                        return;
                                }
                        }
 
                        $out->addWikiMsg( "importstart" );
 
-                       $reporter = new ImportReporter( $importer, $isUpload, $this->interwiki, $this->logcomment );
+                       $reporter = new ImportReporter(
+                               $importer,
+                               $isUpload,
+                               $this->interwiki,
+                               $this->logcomment
+                       );
                        $reporter->setContext( $this->getContext() );
                        $exception = false;
 
@@ -167,10 +182,16 @@ class SpecialImport extends SpecialPage {
 
                        if ( $exception ) {
                                # No source or XML parse error
-                               $out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'importfailed', $exception->getMessage() ) );
-                       } elseif( !$result->isGood() ) {
+                               $out->wrapWikiMsg(
+                                       "<p class=\"error\">\n$1\n</p>",
+                                       array( 'importfailed', $exception->getMessage() )
+                               );
+                       } elseif ( !$result->isGood() ) {
                                # Zero revisions
-                               $out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'importfailed', $result->getWikiText() ) );
+                               $out->wrapWikiMsg(
+                                       "<p class=\"error\">\n$1\n</p>",
+                                       array( 'importfailed', $result->getWikiText() )
+                               );
                        } else {
                                # Success!
                                $out->addWikiMsg( 'importsuccess' );
@@ -186,158 +207,191 @@ class SpecialImport extends SpecialPage {
                $user = $this->getUser();
                $out = $this->getOutput();
 
-               if( $user->isAllowed( 'importupload' ) ) {
+               if ( $user->isAllowed( 'importupload' ) ) {
                        $out->addHTML(
                                Xml::fieldset( $this->msg( 'import-upload' )->text() ) .
-                               Xml::openElement( 'form', array( 'enctype' => 'multipart/form-data', 'method' => 'post',
-                                       'action' => $action, 'id' => 'mw-import-upload-form' ) ) .
-                               $this->msg( 'importtext' )->parseAsBlock() .
-                               Html::hidden( 'action', 'submit' ) .
-                               Html::hidden( 'source', 'upload' ) .
-                               Xml::openElement( 'table', array( 'id' => 'mw-import-table-upload' ) ) .
-
-                               "<tr>
+                                       Xml::openElement(
+                                               'form',
+                                               array(
+                                                       'enctype' => 'multipart/form-data',
+                                                       'method' => 'post',
+                                                       'action' => $action,
+                                                       'id' => 'mw-import-upload-form'
+                                               )
+                                       ) .
+                                       $this->msg( 'importtext' )->parseAsBlock() .
+                                       Html::hidden( 'action', 'submit' ) .
+                                       Html::hidden( 'source', 'upload' ) .
+                                       Xml::openElement( 'table', array( 'id' => 'mw-import-table-upload' ) ) .
+                                       "<tr>
                                        <td class='mw-label'>" .
-                                               Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) .
+                                       Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) .
                                        "</td>
                                        <td class='mw-input'>" .
-                                               Html::input( 'xmlimport', '', 'file', array( 'id' => 'xmlimport' ) ) . ' ' .
+                                       Html::input( 'xmlimport', '', 'file', array( 'id' => 'xmlimport' ) ) . ' ' .
                                        "</td>
                                </tr>
                                <tr>
                                        <td class='mw-label'>" .
-                                               Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) .
+                                       Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) .
                                        "</td>
                                        <td class='mw-input'>" .
-                                               Xml::input( 'log-comment', 50, '',
-                                                       array( 'id' => 'mw-import-comment', 'type' => 'text' ) ) . ' ' .
+                                       Xml::input( 'log-comment', 50, '',
+                                               array( 'id' => 'mw-import-comment', 'type' => 'text' ) ) . ' ' .
                                        "</td>
                                </tr>
                                <tr>
                                        <td class='mw-label'>" .
-                                               Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage-upload' ) .
+                                       Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage-upload' ) .
                                        "</td>
                                        <td class='mw-input'>" .
-                                               Xml::input( 'rootpage', 50, $this->rootpage,
-                                                       array( 'id' => 'mw-interwiki-rootpage-upload', 'type' => 'text' ) ) . ' ' .
+                                       Xml::input( 'rootpage', 50, $this->rootpage,
+                                               array( 'id' => 'mw-interwiki-rootpage-upload', 'type' => 'text' ) ) . ' ' .
                                        "</td>
                                </tr>
                                <tr>
                                        <td></td>
                                        <td class='mw-submit'>" .
-                                               Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) .
+                                       Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) .
                                        "</td>
                                </tr>" .
-                               Xml::closeElement( 'table' ) .
-                               Html::hidden( 'editToken', $user->getEditToken() ) .
-                               Xml::closeElement( 'form' ) .
-                               Xml::closeElement( 'fieldset' )
+                                       Xml::closeElement( 'table' ) .
+                                       Html::hidden( 'editToken', $user->getEditToken() ) .
+                                       Xml::closeElement( 'form' ) .
+                                       Xml::closeElement( 'fieldset' )
                        );
                } else {
-                       if( empty( $wgImportSources ) ) {
+                       if ( empty( $wgImportSources ) ) {
                                $out->addWikiMsg( 'importnosources' );
                        }
                }
 
-               if( $user->isAllowed( 'import' ) && !empty( $wgImportSources ) ) {
+               if ( $user->isAllowed( 'import' ) && !empty( $wgImportSources ) ) {
                        # Show input field for import depth only if $wgExportMaxLinkDepth > 0
                        $importDepth = '';
-                       if( $wgExportMaxLinkDepth > 0 ) {
+                       if ( $wgExportMaxLinkDepth > 0 ) {
                                $importDepth = "<tr>
                                                        <td class='mw-label'>" .
-                                                               $this->msg( 'export-pagelinks' )->parse() .
-                                                       "</td>
+                                       $this->msg( 'export-pagelinks' )->parse() .
+                                       "</td>
                                                        <td class='mw-input'>" .
-                                                               Xml::input( 'pagelink-depth', 3, 0 ) .
-                                                       "</td>
-                                               </tr>";
+                                       Xml::input( 'pagelink-depth', 3, 0 ) .
+                                       "</td>
+                               </tr>";
                        }
 
                        $out->addHTML(
                                Xml::fieldset( $this->msg( 'importinterwiki' )->text() ) .
-                               Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'mw-import-interwiki-form' ) ) .
-                               $this->msg( 'import-interwiki-text' )->parseAsBlock() .
-                               Html::hidden( 'action', 'submit' ) .
-                               Html::hidden( 'source', 'interwiki' ) .
-                               Html::hidden( 'editToken', $user->getEditToken() ) .
-                               Xml::openElement( 'table', array( 'id' => 'mw-import-table-interwiki' ) ) .
-                               "<tr>
+                                       Xml::openElement(
+                                               'form',
+                                               array(
+                                                       'method' => 'post',
+                                                       'action' => $action,
+                                                       'id' => 'mw-import-interwiki-form'
+                                               )
+                                       ) .
+                                       $this->msg( 'import-interwiki-text' )->parseAsBlock() .
+                                       Html::hidden( 'action', 'submit' ) .
+                                       Html::hidden( 'source', 'interwiki' ) .
+                                       Html::hidden( 'editToken', $user->getEditToken() ) .
+                                       Xml::openElement( 'table', array( 'id' => 'mw-import-table-interwiki' ) ) .
+                                       "<tr>
                                        <td class='mw-label'>" .
-                                               Xml::label( $this->msg( 'import-interwiki-source' )->text(), 'interwiki' ) .
+                                       Xml::label( $this->msg( 'import-interwiki-source' )->text(), 'interwiki' ) .
                                        "</td>
                                        <td class='mw-input'>" .
-                                               Xml::openElement( 'select', array( 'name' => 'interwiki', 'id' => 'interwiki' ) )
+                                       Xml::openElement(
+                                               'select',
+                                               array( 'name' => 'interwiki', 'id' => 'interwiki' )
+                                       )
                        );
-                       foreach( $wgImportSources as $prefix ) {
+
+                       foreach ( $wgImportSources as $prefix ) {
                                $selected = ( $this->interwiki === $prefix ) ? ' selected="selected"' : '';
                                $out->addHTML( Xml::option( $prefix, $prefix, $selected ) );
                        }
 
                        $out->addHTML(
-                                               Xml::closeElement( 'select' ) .
-                                               Xml::input( 'frompage', 50, $this->frompage, array( 'id' => 'frompage' ) ) .
+                               Xml::closeElement( 'select' ) .
+                                       Xml::input( 'frompage', 50, $this->frompage, array( 'id' => 'frompage' ) ) .
                                        "</td>
                                </tr>
                                <tr>
                                        <td>
                                        </td>
                                        <td class='mw-input'>" .
-                                               Xml::checkLabel( $this->msg( 'import-interwiki-history' )->text(), 'interwikiHistory', 'interwikiHistory', $this->history ) .
+                                       Xml::checkLabel(
+                                               $this->msg( 'import-interwiki-history' )->text(),
+                                               'interwikiHistory',
+                                               'interwikiHistory',
+                                               $this->history
+                                       ) .
                                        "</td>
                                </tr>
                                <tr>
                                        <td>
                                        </td>
                                        <td class='mw-input'>" .
-                                               Xml::checkLabel( $this->msg( 'import-interwiki-templates' )->text(), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates ) .
+                                       Xml::checkLabel(
+                                               $this->msg( 'import-interwiki-templates' )->text(),
+                                               'interwikiTemplates',
+                                               'interwikiTemplates',
+                                               $this->includeTemplates
+                                       ) .
                                        "</td>
                                </tr>
                                $importDepth
                                <tr>
                                        <td class='mw-label'>" .
-                                               Xml::label( $this->msg( 'import-interwiki-namespace' )->text(), 'namespace' ) .
+                                       Xml::label( $this->msg( 'import-interwiki-namespace' )->text(), 'namespace' ) .
                                        "</td>
                                        <td class='mw-input'>" .
-                                               Html::namespaceSelector(
-                                                       array(
-                                                               'selected' => $this->namespace,
-                                                               'all' => '',
-                                                       ), array(
-                                                               'name'  => 'namespace',
-                                                               'id'    => 'namespace',
-                                                               'class' => 'namespaceselector',
-                                                       )
-                                               ) .
+                                       Html::namespaceSelector(
+                                               array(
+                                                       'selected' => $this->namespace,
+                                                       'all' => '',
+                                               ), array(
+                                                       'name' => 'namespace',
+                                                       'id' => 'namespace',
+                                                       'class' => 'namespaceselector',
+                                               )
+                                       ) .
                                        "</td>
                                </tr>
                                <tr>
                                        <td class='mw-label'>" .
-                                               Xml::label( $this->msg( 'import-comment' )->text(), 'mw-interwiki-comment' ) .
+                                       Xml::label( $this->msg( 'import-comment' )->text(), 'mw-interwiki-comment' ) .
                                        "</td>
                                        <td class='mw-input'>" .
-                                               Xml::input( 'log-comment', 50, '',
-                                                       array( 'id' => 'mw-interwiki-comment', 'type' => 'text' ) ) . ' ' .
+                                       Xml::input( 'log-comment', 50, '',
+                                               array( 'id' => 'mw-interwiki-comment', 'type' => 'text' ) ) . ' ' .
                                        "</td>
                                </tr>
                                <tr>
                                        <td class='mw-label'>" .
-                                               Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage-interwiki' ) .
+                                       Xml::label(
+                                               $this->msg( 'import-interwiki-rootpage' )->text(),
+                                               'mw-interwiki-rootpage-interwiki'
+                                       ) .
                                        "</td>
                                        <td class='mw-input'>" .
-                                               Xml::input( 'rootpage', 50, $this->rootpage,
-                                                       array( 'id' => 'mw-interwiki-rootpage-interwiki', 'type' => 'text' ) ) . ' ' .
+                                       Xml::input( 'rootpage', 50, $this->rootpage,
+                                               array( 'id' => 'mw-interwiki-rootpage-interwiki', 'type' => 'text' ) ) . ' ' .
                                        "</td>
                                </tr>
                                <tr>
                                        <td>
                                        </td>
                                        <td class='mw-submit'>" .
-                                               Xml::submitButton( $this->msg( 'import-interwiki-submit' )->text(), Linker::tooltipAndAccesskeyAttribs( 'import' ) ) .
+                                       Xml::submitButton(
+                                               $this->msg( 'import-interwiki-submit' )->text(),
+                                               Linker::tooltipAndAccesskeyAttribs( 'import' )
+                                       ) .
                                        "</td>
                                </tr>" .
-                               Xml::closeElement( 'table' ) .
-                               Xml::closeElement( 'form' ) .
-                               Xml::closeElement( 'fieldset' )
+                                       Xml::closeElement( 'table' ) .
+                                       Xml::closeElement( 'form' ) .
+                                       Xml::closeElement( 'fieldset' )
                        );
                }
        }
@@ -357,9 +411,16 @@ class ImportReporter extends ContextSource {
        private $mOriginalPageOutCallback = null;
        private $mLogItemCount = 0;
 
+
+       /**
+        * @param WikiImporter $importer
+        * @param $upload
+        * @param $interwiki
+        * @param string|bool $reason
+        */
        function __construct( $importer, $upload, $interwiki, $reason = false ) {
                $this->mOriginalPageOutCallback =
-                               $importer->setPageOutCallback( array( $this, 'reportPage' ) );
+                       $importer->setPageOutCallback( array( $this, 'reportPage' ) );
                $this->mOriginalLogCallback =
                        $importer->setLogItemCallback( array( $this, 'reportLogItem' ) );
                $importer->setNoticeCallback( array( $this, 'reportNotice' ) );
@@ -403,14 +464,15 @@ class ImportReporter extends ContextSource {
 
                $this->mPageCount++;
 
-               if( $successCount > 0 ) {
-                       $this->getOutput()->addHTML( "<li>" . Linker::linkKnown( $title ) . " " .
-                               $this->msg( 'import-revision-count' )->numParams( $successCount )->escaped() .
-                               "</li>\n"
+               if ( $successCount > 0 ) {
+                       $this->getOutput()->addHTML(
+                               "<li>" . Linker::linkKnown( $title ) . " " .
+                                       $this->msg( 'import-revision-count' )->numParams( $successCount )->escaped() .
+                                       "</li>\n"
                        );
 
                        $log = new LogPage( 'import' );
-                       if( $this->mIsUpload ) {
+                       if ( $this->mIsUpload ) {
                                $detail = $this->msg( 'import-logentry-upload-detail' )->numParams(
                                        $successCount )->inContentLanguage()->text();
                                if ( $this->reason ) {
@@ -450,8 +512,9 @@ class ImportReporter extends ContextSource {
                if ( $this->mLogItemCount > 0 ) {
                        $msg = $this->msg( 'imported-log-entries' )->numParams( $this->mLogItemCount )->parse();
                        $out->addHTML( Xml::tags( 'li', null, $msg ) );
-               } elseif( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) {
+               } elseif ( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) {
                        $out->addHTML( "</ul>\n" );
+
                        return Status::newFatal( 'importnopages' );
                }
                $out->addHTML( "</ul>\n" );