r114349 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114348‎ | r114349 | r114350 >
Date:05:32, 21 March 2012
Author:demon
Status:reverted
Tags:gerritmigration 
Comment:
Simplify parameter checking -- 3 local text variables and 7 function calls is also cheaper than 14 function calls
Modified paths:
  • /trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php
@@ -53,13 +53,15 @@
5454 $this->outputHeader();
5555
5656 // if query string includes 'skiptutorial=true' set config variable to true
57 - if ( $wgRequest->getCheck( 'skiptutorial' ) ) {
58 - $skip = in_array( $wgRequest->getText( 'skiptutorial' ), array( '1', 'true' ) );
 57+ $skipTutorial = $wgRequest->getCheck( 'skiptutorial' );
 58+ if ( $skipTutorial ) {
 59+ $skip = in_array( $skipTutorial, array( '1', 'true' ) );
5960 UploadWizardConfig::setUrlSetting( 'skipTutorial', $skip );
6061 }
6162
62 - if ( $wgRequest->getCheck( 'categories' ) ) {
63 - UploadWizardConfig::setUrlSetting( 'defaultCategories', explode( '|', $wgRequest->getText( 'categories' ) ) );
 63+ $categories = $wgRequest->getText( 'categories' );
 64+ if ( $categories ) {
 65+ UploadWizardConfig::setUrlSetting( 'defaultCategories', explode( '|', $categories ) );
6466 }
6567
6668 $ulrArgs = array(
@@ -71,8 +73,9 @@
7274 );
7375
7476 foreach ( $ulrArgs as $arg => $setting ) {
75 - if ( $wgRequest->getCheck( $arg ) ) {
76 - UploadWizardConfig::setUrlSetting( $setting, $wgRequest->getText( $arg ) );
 77+ $value = $wgRequest->getText( $arg );
 78+ if ( $value ) {
 79+ UploadWizardConfig::setUrlSetting( $setting, $value );
7780 }
7881 }
7982

Sign-offs

UserFlagDate
Santhosh.thottingalinspected06:28, 21 March 2012

Follow-up revisions

RevisionCommit summaryAuthorDate
r114400Revert r112166, r112229, r112248, r113584, r113591, r114349: unreviewed revis...catrope20:21, 21 March 2012

Status & tagging log