Collapse some nested if statements
[lhc/web/wiklou.git] / includes / title / MediaWikiTitleCodec.php
index e06bfb5..adbea89 100644 (file)
@@ -421,10 +421,8 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
 
                # Can't make a link to a namespace alone... "empty" local links can only be
                # self-links with a fragment identifier.
-               if ( $dbkey == '' && $parts['interwiki'] === '' ) {
-                       if ( $parts['namespace'] != NS_MAIN ) {
-                               throw new MalformedTitleException( 'title-invalid-empty', $text );
-                       }
+               if ( $dbkey == '' && $parts['interwiki'] === '' && $parts['namespace'] != NS_MAIN ) {
+                       throw new MalformedTitleException( 'title-invalid-empty', $text );
                }
 
                // Allow IPv6 usernames to start with '::' by canonicalizing IPv6 titles.