r76753 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76752‎ | r76753 | r76754 >
Date:01:29, 16 November 2010
Author:neilk
Status:ok
Tags:
Comment:
removed unnecessary error checks
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizardTutorial.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizardTutorial.php
@@ -36,13 +36,7 @@
3737 $errorHtml = '';
3838 $tutorialHtml = '';
3939
40 - // get a valid language code, even if the global is wrong
41 - if ( $wgLang ) {
42 - $langCode = $wgLang->getCode();
43 - }
44 - if ( !isset( $langCode) or $langCode === '' ) {
45 - $langCode = 'en';
46 - }
 40+ $langCode = $wgLang->getCode();
4741
4842 $tutorialFile = false;
4943 // getFile returns false if it can't find the right file
@@ -54,7 +48,7 @@
5549 }
5650
5751 // at this point, we have one of the following situations:
58 - // $error is empty, and tutorialFile is the right one for this language
 52+ // $error is null, and tutorialFile is the right one for this language
5953 // $error notes we couldn't find the tutorialFile for your language, and $tutorialFile is the english one
6054 // $error notes we couldn't find the tutorialFile for your language, and $tutorialFile is still false (major file failure)
6155
@@ -75,7 +69,7 @@
7670 $error = 'file-missing';
7771 }
7872
79 - if ( isset( $error ) ) {
 73+ if ( $error !== null ) {
8074 $errorHtml = Html::element( 'p', array( 'class' => 'errorbox', 'style' => 'float: none;' ), wfMsg( 'mwe-upwiz-tutorial-error-' . $error ) );
8175 }
8276

Status & tagging log