Fix check of return value from SpecialPageFactory::resolveAlias
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 11 Feb 2013 15:59:30 +0000 (16:59 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 18 Feb 2013 08:50:02 +0000 (08:50 +0000)
Calling SpecialPageFactory::resolveAlias with an invalid special page
name, gives an array( null, null ) back, but this part of code checks
explicit against !false, which gives always true. Changed the condition
to use an (implicit) check, like the other places, where
SpecialPageFactory::resolveAlias is called.

Change-Id: I8def9dd88ebfbe9fcf1ba8f9cae9e25039ec77ed

includes/Title.php

index e0585f1..b11d8c1 100644 (file)
@@ -2146,7 +2146,7 @@ class Title {
                                # If it's a special page, ditch the subpage bit and check again
                                $name = $this->getDBkey();
                                list( $name, /* $subpage */ ) = SpecialPageFactory::resolveAlias( $name );
-                               if ( $name !== false ) {
+                               if ( $name ) {
                                        $pure = SpecialPage::getTitleFor( $name )->getPrefixedText();
                                        if ( in_array( $pure, $wgWhitelistRead, true ) ) {
                                                $whitelisted = true;