r77611 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77610‎ | r77611 | r77612 >
Date:22:13, 2 December 2010
Author:reedy
Status:deferred
Tags:
Comment:
Some braces
Modified paths:
  • /trunk/extensions/CreateBox/CreateBox.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CreateBox/CreateBox.php
@@ -53,8 +53,9 @@
5454
5555 function actionCreate( $action, $article ) {
5656 wfLoadExtensionMessages( 'CreateBox' );
57 - if( $action != 'create' )
 57+ if( $action != 'create' ) {
5858 return true;
 59+ }
5960
6061 global $wgRequest;
6162 $prefix = $wgRequest->getVal( 'prefix' );
@@ -65,10 +66,11 @@
6667 global $wgTitle;
6768 $wgTitle = SpecialPage::getTitleFor( 'Badtitle' );
6869 throw new ErrorPageError( 'badtitle', 'badtitletext' );
69 - } elseif( $title->getArticleID() == 0 )
 70+ } elseif( $title->getArticleID() == 0 ) {
7071 acRedirect( $title, 'edit' );
71 - else
 72+ } else {
7273 acRedirect( $title, 'create' );
 74+ }
7375 } elseif( $wgRequest->getVal( 'section' ) == 'new' || $article->getID() == 0 ) {
7476 acRedirect( $article->getTitle(), 'edit' );
7577 } else {
@@ -83,10 +85,11 @@
8486
8587 function acGetOption( $input, $name, $value = null ) {
8688 if( preg_match( "/^\s*$name\s*=\s*(.*)/mi", $input, $matches ) ) {
87 - if( is_int( $value ) )
 89+ if( is_int( $value ) ) {
8890 return intval( $matches[1] );
89 - else
 91+ } else {
9092 return htmlspecialchars( $matches[1] );
 93+ }
9194 }
9295 return $value;
9396 }
@@ -99,8 +102,9 @@
100103 $preload = $wgRequest->getVal( 'preload' );
101104 $editintro = $wgRequest->getVal( 'editintro' );
102105 $text = $parser->getTitle()->getPrefixedText();
103 - if( $prefix && strpos( $text, $prefix ) === 0 )
 106+ if( $prefix && strpos( $text, $prefix ) === 0 ) {
104107 $text = substr( $text, strlen( $prefix ) );
 108+ }
105109 } else {
106110 $prefix = acGetOption( $input, 'prefix' );
107111 $preload = acGetOption( $input, 'preload' );

Status & tagging log