* If restricted read access was enabled, whitelist didn't work with special pages...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 15 Nov 2007 16:32:41 +0000 (16:32 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 15 Nov 2007 16:32:41 +0000 (16:32 +0000)
* If restricted read access was enabled, requests for non-existing special pages threw an exception

RELEASE-NOTES
includes/Title.php

index ae75d88..f06162f 100644 (file)
@@ -153,6 +153,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   the single IP should not unblock the entire range.
 * (bug 6695) Fix native language name of Southern Sotho (Sesotho) (st)
 * Make action=render follow redirects by default
+* If restricted read access was enabled, whitelist didn't work with special
+  pages which had spaces in theirs names
+* If restricted read access was enabled, requests for non-existing special pages
+  threw an exception
 
 === API changes in 1.12 ===
 
index 08ff064..af720ee 100644 (file)
@@ -1321,8 +1321,13 @@ class Title {
                         * and check again
                         */
                        if( $this->getNamespace() == NS_SPECIAL ) {
-                               $name = $this->getText();
+                               $name = $this->getDBKey();
                                list( $name, /* $subpage */) = SpecialPage::resolveAliasWithSubpage( $name );
+                               if ( $name === false ) {
+                                       # Invalid special page, but we show standard login required message
+                                       return false;
+                               }
+
                                $pure = SpecialPage::getTitleFor( $name )->getPrefixedText();
                                if( in_array( $pure, $wgWhitelistRead, true ) )
                                        return true;