From 49b0be69a1b87b602204699ff22f7b9514f72fdd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Thu, 15 Nov 2007 16:32:41 +0000 Subject: [PATCH] * 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 --- RELEASE-NOTES | 4 ++++ includes/Title.php | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ae75d88115..f06162fefa 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Title.php b/includes/Title.php index 08ff064908..af720eed03 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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; -- 2.20.1