Added a pile of missing brackets

Change-Id: Id7b331e1b12875736c8e7e93660e71630360a723
This commit is contained in:
jeroendedauw 2012-09-27 21:46:22 +02:00
parent 66d0bc0527
commit dc8f3e6c78
9 changed files with 58 additions and 25 deletions

View file

@ -1764,8 +1764,9 @@ class Article extends Page {
wfDeprecated( __METHOD__, '1.18' );
if ( $noRedir ) {
$query = 'redirect=no';
if ( $extraQuery )
if ( $extraQuery ) {
$query .= "&$extraQuery";
}
} else {
$query = $extraQuery;
}

View file

@ -287,8 +287,9 @@ class BacklinkCache {
default:
$conds = null;
wfRunHooks( 'BacklinkCacheGetConditions', array( $table, $this->title, &$conds ) );
if( !$conds )
if( !$conds ) {
throw new MWException( "Invalid table \"$table\" in " . __CLASS__ );
}
}
return $conds;

View file

@ -133,8 +133,9 @@ class CdbReader_DBA {
}
function close() {
if( isset($this->handle) )
if( isset($this->handle) ) {
dba_close( $this->handle );
}
unset( $this->handle );
}
@ -164,8 +165,9 @@ class CdbWriter_DBA {
}
function close() {
if( isset($this->handle) )
if( isset($this->handle) ) {
dba_close( $this->handle );
}
if ( wfIsWindows() ) {
unlink( $this->realFileName );
}

View file

@ -224,8 +224,9 @@ class ChangeTags {
public static function buildTagFilterSelector( $selected='', $fullForm = false, Title $title = null ) {
global $wgUseTagFilter;
if ( !$wgUseTagFilter || !count( self::listDefinedTags() ) )
if ( !$wgUseTagFilter || !count( self::listDefinedTags() ) ) {
return $fullForm ? '' : array();
}
$data = array( Html::rawElement( 'label', array( 'for' => 'tagfilter' ), wfMessage( 'tag-filter' )->parse() ),
Xml::input( 'tagfilter', 20, $selected, array( 'class' => 'mw-tagfilter-input' ) ) );

View file

@ -1058,8 +1058,9 @@ class EnhancedChangesList extends ChangesList {
array(),
$params
);
if( $this->isDeleted($rcObj,Revision::DELETED_TEXT) )
if( $this->isDeleted( $rcObj, Revision::DELETED_TEXT ) ) {
$link = '<span class="history-deleted">'.$link.'</span> ';
}
}
$r .= $link . '</span>';

View file

@ -392,10 +392,14 @@ class EditPage {
wfProfileOut( __METHOD__ );
return;
}
if ( !$this->mTitle->getArticleID() )
if ( !$this->mTitle->getArticleID() ) {
wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mTitle ) );
else
}
else {
wfRunHooks( 'EditFormInitialText', array( $this ) );
}
}
$this->showEditForm();
@ -586,8 +590,10 @@ class EditPage {
// modified by subclasses
wfProfileIn( get_class( $this ) . "::importContentFormData" );
$textbox1 = $this->importContentFormData( $request );
if ( isset( $textbox1 ) )
if ( isset( $textbox1 ) ) {
$this->textbox1 = $textbox1;
}
wfProfileOut( get_class( $this ) . "::importContentFormData" );
}
@ -2014,10 +2020,13 @@ class EditPage {
$wgOut->wrapWikiMsg( "<div class='error' id='mw-userinvalidcssjstitle'>\n$1\n</div>", array( 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ) );
}
if ( $this->formtype !== 'preview' ) {
if ( $this->isCssSubpage )
if ( $this->isCssSubpage ) {
$wgOut->wrapWikiMsg( "<div id='mw-usercssyoucanpreview'>\n$1\n</div>", array( 'usercssyoucanpreview' ) );
if ( $this->isJsSubpage )
}
if ( $this->isJsSubpage ) {
$wgOut->wrapWikiMsg( "<div id='mw-userjsyoucanpreview'>\n$1\n</div>", array( 'userjsyoucanpreview' ) );
}
}
}
}
@ -2148,14 +2157,16 @@ class EditPage {
* @return String
*/
protected function getSummaryPreview( $isSubjectPreview, $summary = "" ) {
if ( !$summary || ( !$this->preview && !$this->diff ) )
if ( !$summary || ( !$this->preview && !$this->diff ) ) {
return "";
}
global $wgParser;
if ( $isSubjectPreview )
if ( $isSubjectPreview ) {
$summary = wfMessage( 'newsectionsummary', $wgParser->stripSectionName( $summary ) )
->inContentLanguage()->text();
}
$message = $isSubjectPreview ? 'subject-preview' : 'summary-preview';
@ -2174,8 +2185,9 @@ class EditPage {
HTML
);
if ( !$this->checkUnicodeCompliantBrowser() )
if ( !$this->checkUnicodeCompliantBrowser() ) {
$wgOut->addHTML( Html::hidden( 'safemode', '1' ) );
}
}
protected function showFormAfterText() {
@ -2285,13 +2297,15 @@ HTML
protected function displayPreviewArea( $previewOutput, $isOnTop = false ) {
global $wgOut;
$classes = array();
if ( $isOnTop )
if ( $isOnTop ) {
$classes[] = 'ontop';
}
$attribs = array( 'id' => 'wikiPreview', 'class' => implode( ' ', $classes ) );
if ( $this->formtype != 'preview' )
if ( $this->formtype != 'preview' ) {
$attribs['style'] = 'display: none;';
}
$wgOut->addHTML( Xml::openElement( 'div', $attribs ) );
@ -2568,10 +2582,13 @@ HTML
);
// Quick paranoid permission checks...
if ( is_object( $data ) ) {
if ( $data->log_deleted & LogPage::DELETED_USER )
if ( $data->log_deleted & LogPage::DELETED_USER ) {
$data->user_name = wfMessage( 'rev-deleted-user' )->escaped();
if ( $data->log_deleted & LogPage::DELETED_COMMENT )
}
if ( $data->log_deleted & LogPage::DELETED_COMMENT ) {
$data->log_comment = wfMessage( 'rev-deleted-comment' )->escaped();
}
}
return $data;
}

View file

@ -50,8 +50,9 @@ class ExternalStore {
static function fetchFromURL( $url, $params = array() ) {
global $wgExternalStores;
if( !$wgExternalStores )
if( !$wgExternalStores ) {
return false;
}
$parts = explode( '://', $url, 2 );
@ -66,8 +67,10 @@ class ExternalStore {
}
$store = self::getStoreObject( $proto, $params );
if ( $store === false )
if ( $store === false ) {
return false;
}
return $store->fetchFromURL( $url );
}
@ -80,11 +83,14 @@ class ExternalStore {
*/
static function getStoreObject( $proto, $params = array() ) {
global $wgExternalStores;
if( !$wgExternalStores )
if( !$wgExternalStores ) {
return false;
}
/* Protocol not enabled */
if( !in_array( $proto, $wgExternalStores ) )
if( !in_array( $proto, $wgExternalStores ) ) {
return false;
}
$class = 'ExternalStore' . ucfirst( $proto );
/* Any custom modules should be added to $wgAutoLoadClasses for on-demand loading */

View file

@ -374,8 +374,9 @@ class FileDeleteForm {
$q = array();
$q['action'] = 'delete';
if( $this->oldimage )
if( $this->oldimage ) {
$q['oldimage'] = $this->oldimage;
}
return $this->title->getLocalUrl( $q );
}

View file

@ -117,7 +117,7 @@ class Licenses extends HTMLFormField {
* @param $depth int
*/
protected function makeHtml( $tagset, $depth = 0 ) {
foreach ( $tagset as $key => $val )
foreach ( $tagset as $key => $val ) {
if ( is_array( $val ) ) {
$this->html .= $this->outputOption(
$key, '',
@ -135,6 +135,7 @@ class Licenses extends HTMLFormField {
$depth
);
}
}
}
/**
@ -148,8 +149,10 @@ class Licenses extends HTMLFormField {
$msgObj = $this->msg( $message );
$text = $msgObj->exists() ? $msgObj->text() : $message;
$attribs['value'] = $value;
if ( $value === $this->selected )
if ( $value === $this->selected ) {
$attribs['selected'] = 'selected';
}
$val = str_repeat( /* &nbsp */ "\xc2\xa0", $depth * 2 ) . $text;
return str_repeat( "\t", $depth ) . Xml::element( 'option', $attribs, $val ) . "\n";
}