From dc8f3e6c78eeade71fd6409fc7bd7771d55414ee Mon Sep 17 00:00:00 2001 From: jeroendedauw Date: Thu, 27 Sep 2012 21:46:22 +0200 Subject: [PATCH] Added a pile of missing brackets Change-Id: Id7b331e1b12875736c8e7e93660e71630360a723 --- includes/Article.php | 3 ++- includes/BacklinkCache.php | 3 ++- includes/Cdb.php | 6 ++++-- includes/ChangeTags.php | 3 ++- includes/ChangesList.php | 3 ++- includes/EditPage.php | 41 ++++++++++++++++++++++++++----------- includes/ExternalStore.php | 14 +++++++++---- includes/FileDeleteForm.php | 3 ++- includes/Licenses.php | 7 +++++-- 9 files changed, 58 insertions(+), 25 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 9ab4b6bacc..76e566bd99 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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; } diff --git a/includes/BacklinkCache.php b/includes/BacklinkCache.php index 05bf31865c..d2055dd5c5 100644 --- a/includes/BacklinkCache.php +++ b/includes/BacklinkCache.php @@ -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; diff --git a/includes/Cdb.php b/includes/Cdb.php index ae2e5b18ae..2a6a3d2d41 100644 --- a/includes/Cdb.php +++ b/includes/Cdb.php @@ -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 ); } diff --git a/includes/ChangeTags.php b/includes/ChangeTags.php index 0ebc926fc9..a97cb03482 100644 --- a/includes/ChangeTags.php +++ b/includes/ChangeTags.php @@ -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' ) ) ); diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 84677124eb..e7395c0261 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -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 = ''.$link.' '; + } } $r .= $link . ''; diff --git a/includes/EditPage.php b/includes/EditPage.php index 84695b12f4..c138824688 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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( "
\n$1\n
", array( 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ) ); } if ( $this->formtype !== 'preview' ) { - if ( $this->isCssSubpage ) + if ( $this->isCssSubpage ) { $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'usercssyoucanpreview' ) ); - if ( $this->isJsSubpage ) + } + + if ( $this->isJsSubpage ) { $wgOut->wrapWikiMsg( "
\n$1\n
", 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; } diff --git a/includes/ExternalStore.php b/includes/ExternalStore.php index 61d4ef7c37..391829af1b 100644 --- a/includes/ExternalStore.php +++ b/includes/ExternalStore.php @@ -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 */ diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index e75ad72944..7e616b2493 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -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 ); } diff --git a/includes/Licenses.php b/includes/Licenses.php index ba504a9942..4d2229f0a0 100644 --- a/includes/Licenses.php +++ b/includes/Licenses.php @@ -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( /*   */ "\xc2\xa0", $depth * 2 ) . $text; return str_repeat( "\t", $depth ) . Xml::element( 'option', $attribs, $val ) . "\n"; } -- 2.20.1