From 453264f9041796fea7083b02f90c83baf6d75dff Mon Sep 17 00:00:00 2001 From: umherirrender Date: Mon, 28 Jan 2013 22:11:10 +0100 Subject: [PATCH] fix some spacing Change-Id: I2a59eb22bb8acf01b560507a48d6be55d9c87de7 --- includes/specials/SpecialAllpages.php | 38 ++++++------- includes/specials/SpecialBlock.php | 4 +- includes/specials/SpecialChangeEmail.php | 2 +- includes/specials/SpecialChangePassword.php | 6 +- .../specials/SpecialDeletedContributions.php | 6 +- includes/specials/SpecialDoubleRedirects.php | 4 +- includes/specials/SpecialEditWatchlist.php | 10 ++-- .../specials/SpecialFileDuplicateSearch.php | 2 +- includes/specials/SpecialImport.php | 6 +- includes/specials/SpecialNewpages.php | 4 +- includes/specials/SpecialPrefixindex.php | 6 +- includes/specials/SpecialRecentchanges.php | 20 +++---- .../specials/SpecialRecentchangeslinked.php | 12 ++-- includes/specials/SpecialRevisiondelete.php | 19 +++---- includes/specials/SpecialSearch.php | 56 +++++++++---------- includes/specials/SpecialUndelete.php | 13 +++-- includes/specials/SpecialUploadStash.php | 2 +- includes/specials/SpecialUserrights.php | 4 +- includes/specials/SpecialVersion.php | 8 +-- includes/specials/SpecialWhatlinkshere.php | 12 ++-- 20 files changed, 117 insertions(+), 117 deletions(-) diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index abfb719fa6..df65e4a9b1 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -188,10 +188,10 @@ class SpecialAllpages extends IncludableSpecialPage { $from = ( $from && $from->isLocal() ) ? $from->getDBkey() : null; $to = ( $to && $to->isLocal() ) ? $to->getDBkey() : null; - if( isset($from) ) - $where[] = 'page_title >= '.$dbr->addQuotes( $from ); - if( isset($to) ) - $where[] = 'page_title <= '.$dbr->addQuotes( $to ); + if( isset( $from ) ) + $where[] = 'page_title >= ' . $dbr->addQuotes( $from ); + if( isset( $to ) ) + $where[] = 'page_title <= ' . $dbr->addQuotes( $to ); global $wgMemc; $key = wfMemcKey( 'allpages', 'ns', $namespace, $from, $to ); @@ -217,9 +217,9 @@ class SpecialAllpages extends IncludableSpecialPage { : array( 'page_title >= ' . $dbr->addQuotes( $lastTitle ) ); $res = $dbr->select( 'page', /* FROM */ 'page_title', /* WHAT */ - array_merge($where,$chunk), + array_merge( $where, $chunk ), __METHOD__, - array ('LIMIT' => 2, 'OFFSET' => $maxPerSubpage - 1, 'ORDER BY' => 'page_title ASC') + array( 'LIMIT' => 2, 'OFFSET' => $maxPerSubpage - 1, 'ORDER BY' => 'page_title ASC' ) ); $s = $dbr->fetchObject( $res ); @@ -228,7 +228,7 @@ class SpecialAllpages extends IncludableSpecialPage { } else { // Final chunk, but ended prematurely. Go back and find the end. $endTitle = $dbr->selectField( 'page', 'MAX(page_title)', - array_merge($where,$chunk), + array_merge( $where, $chunk ), __METHOD__ ); array_push( $lines, $endTitle ); $done = true; @@ -272,7 +272,7 @@ class SpecialAllpages extends IncludableSpecialPage { if( $this->including() ) { $out2 = ''; } else { - if( isset($from) || isset($to) ) { + if( isset( $from ) || isset( $to ) ) { $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ). ' ' . @@ -311,12 +311,12 @@ class SpecialAllpages extends IncludableSpecialPage { $queryparams = $namespace ? "namespace=$namespace&" : ''; $queryhideredirects = array(); - if ($hideredirects) { + if ( $hideredirects ) { $queryhideredirects[ 'hideredirects' ] = 1; } $special = $this->getTitle(); - $link = htmlspecialchars( $special->getLocalUrl( $queryparams . 'from=' . urlencode($inpoint) . '&to=' . urlencode($outpoint), $queryhideredirects ) ); + $link = htmlspecialchars( $special->getLocalUrl( $queryparams . 'from=' . urlencode( $inpoint ) . '&to=' . urlencode( $outpoint ), $queryhideredirects ) ); $out = $this->msg( 'alphaindexline' )->rawParams( "$inpointf", @@ -335,7 +335,7 @@ class SpecialAllpages extends IncludableSpecialPage { global $wgContLang; $output = $this->getOutput(); - $fromList = $this->getNamespaceKeyAndText($namespace, $from); + $fromList = $this->getNamespaceKeyAndText( $namespace, $from ); $toList = $this->getNamespaceKeyAndText( $namespace, $to ); $namespaces = $wgContLang->getNamespaces(); $n = 0; @@ -416,10 +416,10 @@ class SpecialAllpages extends IncludableSpecialPage { $res_prev = $dbr->select( 'page', 'page_title', - array( 'page_namespace' => $namespace, 'page_title < '.$dbr->addQuotes($from) ), + array( 'page_namespace' => $namespace, 'page_title < ' . $dbr->addQuotes( $from ) ), __METHOD__, array( 'ORDER BY' => 'page_title DESC', - 'LIMIT' => $this->maxPerPage, 'OFFSET' => ($this->maxPerPage - 1 ) + 'LIMIT' => $this->maxPerPage, 'OFFSET' => ( $this->maxPerPage - 1 ) ) ); @@ -438,7 +438,7 @@ class SpecialAllpages extends IncludableSpecialPage { array( 'page_namespace' => $namespace ), __METHOD__, $options ); # Show the previous link if it s not the current requested chunk if( $from != $reallyFirstPage_title ) { - $prevTitle = Title::makeTitle( $namespace, $reallyFirstPage_title ); + $prevTitle = Title::makeTitle( $namespace, $reallyFirstPage_title ); } else { $prevTitle = null; } @@ -477,7 +477,7 @@ class SpecialAllpages extends IncludableSpecialPage { if( $n == $this->maxPerPage && $s = $res->fetchObject() ) { # $s is the first link of the next chunk - $t = Title::makeTitle($namespace, $s->page_title); + $t = Title::makeTitle( $namespace, $s->page_title ); $query = array( 'from' => $t->getText() ); if( $namespace ) @@ -518,11 +518,11 @@ class SpecialAllpages extends IncludableSpecialPage { * @param $text String: the name of the article * @return array( int namespace, string dbkey, string pagename ) or NULL on error */ - protected function getNamespaceKeyAndText($ns, $text) { + protected function getNamespaceKeyAndText( $ns, $text ) { if ( $text == '' ) return array( $ns, '', '' ); # shortcut for common case - $t = Title::makeTitleSafe($ns, $text); + $t = Title::makeTitleSafe( $ns, $text ); if ( $t && $t->isLocal() ) { return array( $t->getNamespace(), $t->getDBkey(), $t->getText() ); } elseif ( $t ) { @@ -530,8 +530,8 @@ class SpecialAllpages extends IncludableSpecialPage { } # try again, in case the problem was an empty pagename - $text = preg_replace('/(#|$)/', 'X$1', $text); - $t = Title::makeTitleSafe($ns, $text); + $text = preg_replace( '/(#|$)/', 'X$1', $text ); + $t = Title::makeTitleSafe( $ns, $text ); if ( $t && $t->isLocal() ) { return array( $t->getNamespace(), '', '' ); } else { diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index ec026e87ab..b71588d0ac 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -386,7 +386,7 @@ class SpecialBlock extends FormSpecialPage { ); } - $text = Html::rawElement( + $text = Html::rawElement( 'p', array( 'class' => 'mw-ipb-conveniencelinks' ), $this->getLanguage()->pipeList( $links ) @@ -650,7 +650,7 @@ class SpecialBlock extends FormSpecialPage { } if ( $data['HideUser'] ) { - if ( !$performer->isAllowed('hideuser') ) { + if ( !$performer->isAllowed( 'hideuser' ) ) { # this codepath is unreachable except by a malicious user spoofing forms, # or by race conditions (user has oversight and sysop, loads block form, # and is de-oversighted before submission); so need to fail completely diff --git a/includes/specials/SpecialChangeEmail.php b/includes/specials/SpecialChangeEmail.php index eae8e3a148..53faba7a7a 100644 --- a/includes/specials/SpecialChangeEmail.php +++ b/includes/specials/SpecialChangeEmail.php @@ -195,7 +195,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage { if ( $type != 'text' ) { $out .= Xml::label( $this->msg( $label )->text(), $name ); } else { - $out .= $this->msg( $label )->escaped(); + $out .= $this->msg( $label )->escaped(); } $out .= "\n"; $out .= "\t"; diff --git a/includes/specials/SpecialChangePassword.php b/includes/specials/SpecialChangePassword.php index 54a277183b..6280eb465c 100644 --- a/includes/specials/SpecialChangePassword.php +++ b/includes/specials/SpecialChangePassword.php @@ -112,7 +112,7 @@ class SpecialChangePassword extends UnlistedSpecialPage { * @param $msg string */ function error( $msg ) { - $this->getOutput()->addHTML( Xml::element('p', array( 'class' => 'error' ), $msg ) ); + $this->getOutput()->addHTML( Xml::element( 'p', array( 'class' => 'error' ), $msg ) ); } function showForm() { @@ -202,7 +202,7 @@ class SpecialChangePassword extends UnlistedSpecialPage { if ( $type != 'text' ) $out .= Xml::label( $this->msg( $label )->text(), $name ); else - $out .= $this->msg( $label )->escaped(); + $out .= $this->msg( $label )->escaped(); $out .= "\n"; $out .= "\t"; $out .= $field; @@ -231,7 +231,7 @@ class SpecialChangePassword extends UnlistedSpecialPage { throw new PasswordError( $this->msg( 'login-throttled' )->text() ); } - if( !$user->checkTemporaryPassword($this->mOldpass) && !$user->checkPassword($this->mOldpass) ) { + if( !$user->checkTemporaryPassword( $this->mOldpass ) && !$user->checkPassword( $this->mOldpass ) ) { wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'wrongpassword' ) ); throw new PasswordError( $this->msg( 'resetpass-wrong-oldpass' )->text() ); } diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index bdeb7fef95..0c934a4933 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -168,7 +168,7 @@ class DeletedContribsPager extends IndexPager { $user = $this->getUser(); - if( $user->isAllowed('deletedtext') ) { + if( $user->isAllowed( 'deletedtext' ) ) { $last = Linker::linkKnown( $undelete, $this->messages['diff'], @@ -475,7 +475,7 @@ class DeletedContributionsPage extends SpecialPage { if ( !isset( $options['target'] ) ) { $options['target'] = ''; } else { - $options['target'] = str_replace( '_' , ' ' , $options['target'] ); + $options['target'] = str_replace( '_', ' ', $options['target'] ); } if ( !isset( $options['namespace'] ) ) { @@ -499,7 +499,7 @@ class DeletedContributionsPage extends SpecialPage { $f .= "\t" . Html::hidden( $name, $value ) . "\n"; } - $f .= Xml::openElement( 'fieldset' ) . + $f .= Xml::openElement( 'fieldset' ) . Xml::element( 'legend', array(), $this->msg( 'sp-contributions-search' )->text() ) . Xml::tags( 'label', array( 'for' => 'target' ), $this->msg( 'sp-contributions-username' )->parse() ) . ' ' . Html::input( 'target', $options['target'], 'text', array( diff --git a/includes/specials/SpecialDoubleRedirects.php b/includes/specials/SpecialDoubleRedirects.php index ee073235e0..9c47554889 100644 --- a/includes/specials/SpecialDoubleRedirects.php +++ b/includes/specials/SpecialDoubleRedirects.php @@ -117,7 +117,7 @@ class DoubleRedirectsPage extends QueryPage { $dbr = wfGetDB( DB_SLAVE ); $qi = $this->reallyGetQueryInfo( $result->namespace, $result->title ); - $res = $dbr->select($qi['tables'], $qi['fields'], + $res = $dbr->select( $qi['tables'], $qi['fields'], $qi['conds'], __METHOD__ ); if ( $res ) { $result = $dbr->fetchObject( $res ); @@ -128,7 +128,7 @@ class DoubleRedirectsPage extends QueryPage { } $titleB = Title::makeTitle( $result->nsb, $result->tb ); - $titleC = Title::makeTitle( $result->nsc, $result->tc, '', $result->iwc ); + $titleC = Title::makeTitle( $result->nsc, $result->tc, '', $result->iwc ); $linkA = Linker::linkKnown( $titleA, diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 6d5205a2d8..40971c78bd 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -289,7 +289,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { $res = $dbr->select( array( 'watchlist' ), - array( 'wl_namespace', 'wl_title' ), + array( 'wl_namespace', 'wl_title' ), array( 'wl_user' => $this->getUser()->getId() ), __METHOD__, array( 'ORDER BY' => array( 'wl_namespace', 'wl_title' ) ) @@ -478,7 +478,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { foreach( $this->getWatchlistInfo() as $namespace => $pages ) { if ( $namespace >= 0 ) { - $fields['TitlesNs'.$namespace] = array( + $fields['TitlesNs' . $namespace] = array( 'class' => 'EditWatchlistCheckboxSeriesField', 'options' => array(), 'section' => "ns$namespace", @@ -489,7 +489,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { $title = Title::makeTitleSafe( $namespace, $dbkey ); if ( $this->checkTitle( $title, $namespace, $dbkey ) ) { $text = $this->buildRemoveLine( $title ); - $fields['TitlesNs'.$namespace]['options'][$text] = $title->getPrefixedText(); + $fields['TitlesNs' . $namespace]['options'][$text] = $title->getPrefixedText(); $count++; } } @@ -519,7 +519,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { $form->setTitle( $this->getTitle() ); $form->setSubmitTextMsg( 'watchlistedit-normal-submit' ); # Used message keys: 'accesskey-watchlistedit-normal-submit', 'tooltip-watchlistedit-normal-submit' - $form->setSubmitTooltip('watchlistedit-normal-submit'); + $form->setSubmitTooltip( 'watchlistedit-normal-submit' ); $form->setWrapperLegendMsg( 'watchlistedit-normal-legend' ); $form->addHeaderText( $this->msg( 'watchlistedit-normal-explain' )->parse() ); $form->setSubmitCallback( array( $this, 'submitNormal' ) ); @@ -577,7 +577,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { $form->setTitle( $this->getTitle( 'raw' ) ); $form->setSubmitTextMsg( 'watchlistedit-raw-submit' ); # Used message keys: 'accesskey-watchlistedit-raw-submit', 'tooltip-watchlistedit-raw-submit' - $form->setSubmitTooltip('watchlistedit-raw-submit'); + $form->setSubmitTooltip( 'watchlistedit-raw-submit' ); $form->setWrapperLegendMsg( 'watchlistedit-raw-legend' ); $form->addHeaderText( $this->msg( 'watchlistedit-raw-explain' )->parse() ); $form->setSubmitCallback( array( $this, 'submitRaw' ) ); diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 96739ea5e3..366aa81e90 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -101,7 +101,7 @@ class FileDuplicateSearchPage extends QueryPage { $this->setHeaders(); $this->outputHeader(); - $this->filename = isset( $par ) ? $par : $this->getRequest()->getText( 'filename' ); + $this->filename = isset( $par ) ? $par : $this->getRequest()->getText( 'filename' ); $this->file = null; $this->hash = ''; $title = Title::newFromText( $this->filename, NS_FILE ); diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 724747093a..9fb0f9e969 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -410,7 +410,7 @@ class ImportReporter extends ContextSource { $detail = $this->msg( 'import-logentry-upload-detail' )->numParams( $successCount )->inContentLanguage()->text(); if ( $this->reason ) { - $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason; + $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason; } $log->addEntry( 'upload', $title, $detail ); } else { @@ -419,7 +419,7 @@ class ImportReporter extends ContextSource { $detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams( $successCount )->params( $interwiki )->inContentLanguage()->text(); if ( $this->reason ) { - $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason; + $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->reason; } $log->addEntry( 'interwiki', $title, $detail ); } @@ -428,7 +428,7 @@ class ImportReporter extends ContextSource { $dbw = wfGetDB( DB_MASTER ); $latest = $title->getLatestRevID(); $nullRevision = Revision::newNullRevision( $dbw, $title->getArticleID(), $comment, true ); - if (!is_null($nullRevision)) { + if ( !is_null( $nullRevision ) ) { $nullRevision->insertOn( $dbw ); $page = WikiPage::factory( $title ); # Update page record diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index d9d6a79608..053c01526e 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -105,7 +105,7 @@ class SpecialNewpages extends IncludableSpecialPage { } // PG offsets not just digits! if ( preg_match( '/^offset=([^=]+)$/', $bit, $m ) ) { - $this->opts->setValue( 'offset', intval( $m[1] ) ); + $this->opts->setValue( 'offset', intval( $m[1] ) ); } if ( preg_match( '/^username=(.*)$/', $bit, $m ) ) { $this->opts->setValue( 'username', $m[1] ); @@ -113,7 +113,7 @@ class SpecialNewpages extends IncludableSpecialPage { if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) { $ns = $this->getLanguage()->getNsIndex( $m[1] ); if( $ns !== false ) { - $this->opts->setValue( 'namespace', $ns ); + $this->opts->setValue( 'namespace', $ns ); } } } diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index f3895e8382..f486ea83f6 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -145,8 +145,8 @@ class SpecialPrefixindex extends SpecialAllpages { $from = $prefix; } - $fromList = $this->getNamespaceKeyAndText($namespace, $from); - $prefixList = $this->getNamespaceKeyAndText($namespace, $prefix); + $fromList = $this->getNamespaceKeyAndText( $namespace, $from ); + $prefixList = $this->getNamespaceKeyAndText( $namespace, $prefix ); $namespaces = $wgContLang->getNamespaces(); if ( !$prefixList || !$fromList ) { @@ -227,7 +227,7 @@ class SpecialPrefixindex extends SpecialAllpages { } else { $nsForm = $this->namespacePrefixForm( $namespace, $prefix, $hideredirects ); $self = $this->getTitle(); - $out2 = Xml::openElement( 'table', array( 'id' => 'mw-prefixindex-nav-table' ) ) . + $out2 = Xml::openElement( 'table', array( 'id' => 'mw-prefixindex-nav-table' ) ) . ' ' . $nsForm . diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 6502c7256a..cd1d2567da 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -42,16 +42,16 @@ class SpecialRecentChanges extends IncludableSpecialPage { public function getDefaultOptions() { $opts = new FormOptions(); - $opts->add( 'days', (int)$this->getUser()->getOption( 'rcdays' ) ); + $opts->add( 'days', (int)$this->getUser()->getOption( 'rcdays' ) ); $opts->add( 'limit', (int)$this->getUser()->getOption( 'rclimit' ) ); $opts->add( 'from', '' ); - $opts->add( 'hideminor', $this->getUser()->getBoolOption( 'hideminor' ) ); - $opts->add( 'hidebots', true ); - $opts->add( 'hideanons', false ); - $opts->add( 'hideliu', false ); + $opts->add( 'hideminor', $this->getUser()->getBoolOption( 'hideminor' ) ); + $opts->add( 'hidebots', true ); + $opts->add( 'hideanons', false ); + $opts->add( 'hideliu', false ); $opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'hidepatrolled' ) ); - $opts->add( 'hidemyself', false ); + $opts->add( 'hidemyself', false ); $opts->add( 'namespace', '', FormOptions::INTNULL ); $opts->add( 'invert', false ); @@ -232,7 +232,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { } if( is_numeric( $bit ) ) { - $opts['limit'] = $bit; + $opts['limit'] = $bit; } $m = array(); @@ -296,7 +296,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { $cutoff_unixtime = $cutoff_unixtime - ($cutoff_unixtime % 86400); $cutoff = $dbr->timestamp( $cutoff_unixtime ); - $fromValid = preg_match('/^[0-9]{14}$/', $opts['from']); + $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] ); if( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) { $cutoff = $dbr->timestamp( $opts['from'] ); } else { @@ -387,7 +387,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { $tables[] = 'watchlist'; $fields[] = 'wl_user'; $fields[] = 'wl_notificationtimestamp'; - $join_conds['watchlist'] = array('LEFT JOIN', array( + $join_conds['watchlist'] = array( 'LEFT JOIN', array( 'wl_user' => $uid, 'wl_title=rc_title', 'wl_namespace=rc_namespace' @@ -396,7 +396,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { if ( $this->getUser()->isAllowed( 'rollback' ) ) { $tables[] = 'page'; $fields[] = 'page_latest'; - $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id'); + $join_conds['page'] = array( 'LEFT JOIN', 'rc_cur_id=page_id' ); } // Tag stuff. ChangeTags::modifyDisplayQuery( diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index 3dae3a7ad2..6d7173b320 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -110,7 +110,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges { } if ( $this->getUser()->isAllowed( 'rollback' ) ) { $tables[] = 'page'; - $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id'); + $join_conds['page'] = array( 'LEFT JOIN', 'rc_cur_id=page_id' ); $select[] = 'page_latest'; } ChangeTags::modifyDisplayQuery( @@ -204,15 +204,15 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges { $subsql[] = $query; } - if( count($subsql) == 0 ) { + if( count( $subsql ) == 0 ) { return false; // should never happen } - if( count($subsql) == 1 && $dbr->unionSupportsOrderAndLimit() ) { + if( count( $subsql ) == 1 && $dbr->unionSupportsOrderAndLimit() ) { $sql = $subsql[0]; } else { // need to resort and relimit after union - $sql = $dbr->unionQueries($subsql, false).' ORDER BY rc_timestamp DESC'; - $sql = $dbr->limitResult($sql, $limit, false); + $sql = $dbr->unionQueries( $subsql, false ) . ' ORDER BY rc_timestamp DESC'; + $sql = $dbr->limitResult( $sql, $limit, false ); } $res = $dbr->query( $sql, __METHOD__ ); @@ -237,7 +237,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges { Xml::check( 'showlinkedto', $opts['showlinkedto'], array( 'id' => 'showlinkedto' ) ) . ' ' . Xml::label( $this->msg( 'recentchangeslinked-to' )->text(), 'showlinkedto' ) ); $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] ); - if ($tagFilter) { + if ( $tagFilter ) { $extraOpts['tagfilter'] = $tagFilter; } return $extraOpts; diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index eaf0d52f23..305d13b921 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -133,7 +133,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $this->ids = explode( ',', $ids ); } else { # Array input - $this->ids = array_keys( $request->getArray('ids',array()) ); + $this->ids = array_keys( $request->getArray( 'ids', array() ) ); } // $this->ids = array_map( 'intval', $this->ids ); $this->ids = array_unique( array_filter( $this->ids ) ); @@ -191,7 +191,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $this->otherReason = $request->getVal( 'wpReason' ); # We need a target page! - if( is_null($this->targetObj) ) { + if( is_null( $this->targetObj ) ) { $output->addWikiMsg( 'undelete-header' ); return; } @@ -204,7 +204,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ), array( 'revdelete-hide-user', 'wpHideUser', Revision::DELETED_USER ) ); - if( $user->isAllowed('suppressrevision') ) { + if( $user->isAllowed( 'suppressrevision' ) ) { $this->checks[] = array( 'revdelete-hide-restricted', 'wpHideRestricted', Revision::DELETED_RESTRICTED ); } @@ -225,7 +225,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { # Show relevant lines from the suppression log if( $user->isAllowed( 'suppressionlog' ) ) { $suppressLogPage = new LogPage( 'suppress' ); - $output->addHTML( "

" . $suppressLogPage->getName()->escaped() . "

\n" ); + $output->addHTML( "

" . $suppressLogPage->getName()->escaped() . "

\n" ); LogEventsList::showLogExtract( $output, 'suppress', $this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) ); } @@ -253,7 +253,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { array( 'action' => 'history' ) ); # Link to deleted edits - if( $this->getUser()->isAllowed('undelete') ) { + if( $this->getUser()->isAllowed( 'undelete' ) ) { $undelete = SpecialPage::getTitleFor( 'Undelete' ); $links[] = Linker::linkKnown( $undelete, @@ -356,7 +356,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $UserAllowed = true; if ( $this->typeName == 'logging' ) { - $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLanguage()->formatNum( count($this->ids) ) ); + $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLanguage()->formatNum( count( $this->ids ) ) ); } else { $this->getOutput()->addWikiMsg( 'revdelete-selected', $this->targetObj->getPrefixedText(), count( $this->ids ) ); @@ -522,7 +522,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { */ protected function submit() { # Check edit token on submission - $token = $this->getRequest()->getVal('wpEditToken'); + $token = $this->getRequest()->getVal( 'wpEditToken' ); if( $this->submitClicked && !$this->getUser()->matchEditToken( $token ) ) { $this->getOutput()->addWikiMsg( 'sessionfailure' ); return false; @@ -537,7 +537,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $comment = $this->otherReason; } # Can the user set this field? - if( $bitParams[Revision::DELETED_RESTRICTED]==1 && !$this->getUser()->isAllowed('suppressrevision') ) { + if( $bitParams[Revision::DELETED_RESTRICTED] == 1 && !$this->getUser()->isAllowed( 'suppressrevision' ) ) { throw new PermissionsError( 'suppressrevision' ); } # If the save went through, go to success message... @@ -586,7 +586,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { } $bitfield[$field] = $val; } - if( !isset($bitfield[Revision::DELETED_RESTRICTED]) ) { + if( !isset( $bitfield[Revision::DELETED_RESTRICTED] ) ) { $bitfield[Revision::DELETED_RESTRICTED] = 0; } return $bitfield; @@ -624,4 +624,3 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { ); } } - diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 397a24f542..823ecc9551 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -138,7 +138,7 @@ class SpecialSearch extends SpecialPage { // BC with old request format $profile = 'advanced'; foreach( $profiles as $key => $data ) { - if ( $nslist === $data['namespaces'] && $key !== 'advanced') { + if ( $nslist === $data['namespaces'] && $key !== 'advanced' ) { $profile = $key; } } @@ -159,7 +159,7 @@ class SpecialSearch extends SpecialPage { $default = $request->getBool( 'profile' ) ? 0 : 1; $this->searchRedirects = $request->getBool( 'redirs', $default ) ? 1 : 0; $this->didYouMeanHtml = ''; # html of did you mean... link - $this->fulltext = $request->getVal('fulltext'); + $this->fulltext = $request->getVal( 'fulltext' ); $this->profile = $profile; } @@ -218,7 +218,7 @@ class SpecialSearch extends SpecialPage { $search->showRedirects = $this->searchRedirects; // BC $search->setFeatureData( 'list-redirects', $this->searchRedirects ); $search->prefix = $this->mPrefix; - $term = $search->transformSearchTerm($term); + $term = $search->transformSearchTerm( $term ); wfRunHooks( 'SpecialSearchSetupEngine', array( $this, $this->profile, $search ) ); @@ -250,7 +250,7 @@ class SpecialSearch extends SpecialPage { $t = Title::newFromText( $term ); // fetch search results - $rewritten = $search->replacePrefixes($term); + $rewritten = $search->replacePrefixes( $term ); $titleMatches = $search->searchTitle( $rewritten ); if( !( $titleMatches instanceof SearchResultTooMany ) ) { @@ -311,9 +311,9 @@ class SpecialSearch extends SpecialPage { Xml::openElement( 'tr' ) . Xml::openElement( 'td' ) . "\n" . $this->shortDialog( $term ) . - Xml::closeElement('td') . - Xml::closeElement('tr') . - Xml::closeElement('table') + Xml::closeElement( 'td' ) . + Xml::closeElement( 'tr' ) . + Xml::closeElement( 'table' ) ); // Sometimes the search engine knows there are too many hits @@ -323,7 +323,7 @@ class SpecialSearch extends SpecialPage { return; } - $filePrefix = $wgContLang->getFormattedNsText(NS_FILE).':'; + $filePrefix = $wgContLang->getFormattedNsText( NS_FILE ) . ':'; if( trim( $term ) === '' || $filePrefix === trim( $term ) ) { $out->addHTML( $this->formHeader( $term, 0, 0 ) ); $out->addHtml( $this->getProfileForm( $this->profile, $term ) ); @@ -347,9 +347,9 @@ class SpecialSearch extends SpecialPage { // get total number of results if backend can calculate it $totalRes = 0; - if($titleMatches && !is_null( $titleMatches->getTotalHits() ) ) + if( $titleMatches && !is_null( $titleMatches->getTotalHits() ) ) $totalRes += $titleMatches->getTotalHits(); - if($textMatches && !is_null( $textMatches->getTotalHits() )) + if( $textMatches && !is_null( $textMatches->getTotalHits() ) ) $totalRes += $textMatches->getTotalHits(); // show number of results and current offset @@ -516,7 +516,7 @@ class SpecialSearch extends SpecialPage { $out = ""; $infoLine = $matches->getInfo(); - if( !is_null($infoLine) ) { + if( !is_null( $infoLine ) ) { $out .= "\n\n"; } $out .= "