Page MenuHomePhabricator

Spaces in mediawiki name causes infinite redirect loop
Closed, DeclinedPublic

Description

Author: ziba

Description:
The new WebRequest::interpolateTitle method in 1.11 passes at least 2 arguments to WebRequest::extractTitle:

$path and $wgArticlePath

$path is urlencoded, $wgArticlePath is not.

WebRequest:extractTitle does a substring comparison on the two arguments. This works fine if there were no urlencoded characters in $path. But as soon as $path has a %20 or the like, WebRequest:extractTitle returns false, so WebRequest::interpolateTitle doesn't populate $_GET, so mediawiki redirects over and over trying to populate $_GET.

For my uses and simple testing so far, this solution seems to have worked:

In includes/WebRequest.php on line 53 change:

$path = $a['path'];

to

$path = urldecode($a['path']);

Thank you for your time in looking at this.


Version: 1.11.x
Severity: major

Details

Reference
bz11314

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:57 PM
bzimport set Reference to bz11314.
bzimport added a subscriber: Unknown Object (MLST).

$wgArticlePath *should* be properly URL-encoded, as it's used to construct URLs.

The installer may not be putting together a proper default $wgScriptPath, however... Linking this bug to bug 10787, which has some further discussion on the matter.

$wgArticlePath should already be encoded, rather than having the code waste the time encoding it.