r78816 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78815‎ | r78816 | r78817 >
Date:18:25, 22 December 2010
Author:reedy
Status:ok
Tags:
Comment:
Spaces and braces
Modified paths:
  • /trunk/phase3/includes/specials/SpecialExport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialExport.php
@@ -68,7 +68,9 @@
6969 * during the export in a single query.
7070 */
7171 $catpages = $this->getPagesFromCategory( $t );
72 - if ( $catpages ) $page .= "\n" . implode( "\n", $catpages );
 72+ if ( $catpages ) {
 73+ $page .= "\n" . implode( "\n", $catpages );
 74+ }
7375 }
7476 }
7577 }
@@ -81,7 +83,9 @@
8284 * Same implementation as above, so same @todo
8385 */
8486 $nspages = $this->getPagesFromNamespace( $nsindex );
85 - if ( $nspages ) $page .= "\n" . implode( "\n", $nspages );
 87+ if ( $nspages ) {
 88+ $page .= "\n" . implode( "\n", $nspages );
 89+ }
8690 }
8791 }
8892 else if( $wgRequest->wasPosted() && $par == '' ) {
@@ -118,7 +122,9 @@
119123 }
120124 }
121125
122 - if( $page != '' ) $this->doExport = true;
 126+ if( $page != '' ) {
 127+ $this->doExport = true;
 128+ }
123129 } else {
124130 // Default to current-only for GET requests.
125131 $page = $wgRequest->getText( 'pages', $par );
@@ -130,7 +136,9 @@
131137 $history = WikiExporter::CURRENT;
132138 }
133139
134 - if( $page != '' ) $this->doExport = true;
 140+ if( $page != '' ) {
 141+ $this->doExport = true;
 142+ }
135143 }
136144
137145 if( !$wgExportAllowHistory ) {
@@ -139,7 +147,9 @@
140148 }
141149
142150 $list_authors = $wgRequest->getCheck( 'listauthors' );
143 - if ( !$this->curonly || !$wgExportAllowListContributors ) $list_authors = false ;
 151+ if ( !$this->curonly || !$wgExportAllowListContributors ) {
 152+ $list_authors = false ;
 153+ }
144154
145155 if ( $this->doExport ) {
146156 $wgOut->disable();
@@ -286,8 +296,12 @@
287297 }*/
288298 #Bug 8824: Only export pages the user can read
289299 $title = Title::newFromText( $page );
290 - if( is_null( $title ) ) continue; #TODO: perhaps output an <error> tag or something.
291 - if( !$title->userCanRead() ) continue; #TODO: perhaps output an <error> tag or something.
 300+ if( is_null( $title ) ) {
 301+ continue; #TODO: perhaps output an <error> tag or something.
 302+ }
 303+ if( !$title->userCanRead() ) {
 304+ continue; #TODO: perhaps output an <error> tag or something.
 305+ }
292306
293307 $exporter->pageByTitle( $title );
294308 }
@@ -394,7 +408,7 @@
395409
396410 /** Expand a list of pages to include pages linked to from that page. */
397411 private function getPageLinks( $inputPages, $pageSet, $depth ) {
398 - for(; $depth > 0; --$depth ) {
 412+ for( ; $depth > 0; --$depth ) {
399413 $pageSet = $this->getLinks(
400414 $inputPages, $pageSet, 'pagelinks',
401415 array( 'pl_namespace AS namespace', 'pl_title AS title' ),

Status & tagging log