Last modified: 2010-05-15 15:59:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T13668, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11668 - Loading a special page fails when the option read is set to false for anonymous users.
Loading a special page fails when the option read is set to false for anonymo...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.11.x
All Linux
: High critical with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 12418 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-15 12:55 UTC by a.steffan
Modified: 2010-05-15 15:59 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description a.steffan 2007-10-15 12:55:59 UTC
Hello, there occurs a grave error when I try to open a special page like "Letzte Änderungen" (Recent changes) or "Zufällige Seite" (Random article) and the setting $wgGroupPermissions['*']['read']  is set to false ($wgGroupPermissions['*']['read'] = false;).

The page loading fails and throw following error:


Invalid special page name ""

Backtrace:

#0 /services/www/wwwroot/mscwiki/current/current/includes/Title.php(1307): SpecialPage::getTitleFor(false)
#1 /services/www/wwwroot/mscwiki/current/current/includes/Wiki.php(133): Title->userCanRead()
#2 /services/www/wwwroot/mscwiki/current/current/includes/Wiki.php(43): MediaWiki->preliminaryChecks(Object(Title), Object(StubObject), Object(WebRequest))
#3 /services/www/wwwroot/mscwiki/current/current/index.php(89): MediaWiki->initialize(Object(Title), Object(StubObject), Object(User), Object(WebRequest))
#4 {main}


To get the mediawiki running I had to modify the Title.php:

I modified the includes/Title.php 
// I added this line
$name = str_replace(" ",'_',$name);
// above this one.
list( $name, /* $subpage */) = SpecialPage::resolveAliasWithSubpage( $name );
Comment 1 Roan Kattouw 2007-10-15 13:00:38 UTC
Were you logged in when this happened? is Special:Recentchanges in $wgWhitelistRead?
Comment 2 a.steffan 2007-10-15 13:04:19 UTC
I didn't logged in, I tried to open the page as an anonymous user. $wgWhitelistRead is empty.

The target is to prevent the access for anonymous users.
Comment 3 Roan Kattouw 2007-10-15 13:06:38 UTC
(In reply to comment #2)
> I didn't logged in, I tried to open the page as an anonymous user.
> $wgWhitelistRead is empty.
> 
> The target is to prevent the access for anonymous users.
> 

You will at the very least need to have [[Special:Userlogin]] in your whitelist, or you won't be able to log in. Ever. Still, this behavior is weird and shouldn't happen.
Comment 4 a.steffan 2007-10-15 13:11:42 UTC
In version 1.11.0 you don't need to define the userlogin page in the whitelist-array. Have a look at the Title.php, line 1274 and further:

/**
* Always grant access to the login page.
* Even anons need to be able to log in.
*/
if( $this->isSpecial( 'Userlogin' ) || $this->isSpecial( 'Resetpass' ) ) {
return true;
}
Comment 5 Brion Vibber 2007-10-15 21:10:29 UTC
Ugh, this whole thing seems a mess...

This works:
$wgWhitelistRead = array('Spezial:Letzte Änderungen');

This causes the fatal error:
$wgWhitelistRead = array('Spezial:Letzte_Änderungen');

Errrrrp? :P

Normalizing ' ' to '_' in SpecialPage::resolveAlias() seems to make both cases work, but I'm a little vague on what's going on in the first place... or how this makes a difference in the described behavior at all. :) The whitelist code is pretty darn awful.
Comment 6 Thomas Andersen 2007-12-17 03:30:53 UTC
I seem to have the same problem in mediawiki-1.11.0.

If I put "$wgGroupPermissions['*']['read'] = false;" in LocalSettings.php and then try to view any of the special pages, I get the following error message:



Invalid special page name ""

Backtrace:

#0 /www/(hidden)/html/includes/Title.php(1305): SpecialPage::getTitleFor(false)
#1 /www/(hidden)/html/includes/Wiki.php(133): Title->userCanRead()
#2 /www/(hidden)/html/includes/Wiki.php(43): MediaWiki->preliminaryChecks(Object(Title), Object(StubObject), Object(WebRequest))
#3 /www/(hidden)/html/index.php(89): MediaWiki->initialize(Object(Title), Object(StubObject), Object(User), Object(WebRequest))
#4 {main}



I tried to do the same as you said, placing the following line in includes/Title.php
$name = str_replace(" ",'_',$name);
like this:

$name = $this->getText();
$name = str_replace(" ",'_',$name); // this is the new line (line number 1304).
list( $name, /* $subpage */) = SpecialPage::resolveAliasWithSubpage( $name );

It seem to work fine now. Thanks!

I hope they include a fix this in the new version;)
Comment 7 Brion Vibber 2007-12-18 02:30:13 UTC
Current trunk (as of r28609) doesn't crash, but it does fail to recognize the version with underscore. (That is, you get a permission failure instead of the expected special page.)
Comment 8 Brion Vibber 2007-12-28 01:12:51 UTC
*** Bug 12418 has been marked as a duplicate of this bug. ***
Comment 9 Aaron Schulz 2008-05-16 20:06:43 UTC
Fixed in r34934

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links