r97384 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97383‎ | r97384 | r97385 >
Date:19:09, 17 September 2011
Author:ialex
Status:ok
Tags:
Comment:
Don't use isset() to check for null
Modified paths:
  • /trunk/phase3/includes/WikiMap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WikiMap.php
@@ -17,15 +17,14 @@
1818 $wgConf->loadFullData();
1919
2020 list( $major, $minor ) = $wgConf->siteFromDB( $wikiID );
21 - if( isset( $major ) ) {
22 - $server = $wgConf->get( 'wgCanonicalServer', $wikiID, $major,
23 - array( 'lang' => $minor, 'site' => $major ) );
24 - $path = $wgConf->get( 'wgArticlePath', $wikiID, $major,
25 - array( 'lang' => $minor, 'site' => $major ) );
26 - return new WikiReference( $major, $minor, $server, $path );
27 - } else {
 21+ if( $major === null ) {
2822 return null;
2923 }
 24+ $server = $wgConf->get( 'wgCanonicalServer', $wikiID, $major,
 25+ array( 'lang' => $minor, 'site' => $major ) );
 26+ $path = $wgConf->get( 'wgArticlePath', $wikiID, $major,
 27+ array( 'lang' => $minor, 'site' => $major ) );
 28+ return new WikiReference( $major, $minor, $server, $path );
3029 }
3130
3231 /**

Status & tagging log