I think I have found the problem causing the continuous redirect on my test 
wiki. However, since I am new at this, I want to run this past someone with a 
better understanding of the code to make sure I have it right.

At line 145 of WebRequest::extractTitle() [r53551] is the following test:

if( substr( $path, 0, $baseLen ) == $base )

This is checking that the string in $base is the prefix of the last element in 
$path. However, the code in this method does not take into account that the 
pathname in the URL might have spaces translated into '%20' escape codes.

The URL to my testwiki is:

'/MediawikiTest/Latest%20Trunk%20Version/phase3/index.php/Main_Page'

This is the value in $path. However, the value in $base is:

'/MediawikiTest/Latest Trunk Version/phase3/index.php/'

So, the call to substr fails and the code that sets 'title' in $matches never 
executes (which means $_GET never gets a 'title' entry). The solution is to 
either convert the '%20' escapes in $path to blanks or convert the blanks in 
$base to '%20' escapes. This bug could be fixed in extractTitle() or since 
$path is an argument of this method and $base is extracted from an argument, 
perhaps it should be fixed elsewhere.

If someone confirms this is a bug, I will open a bug report in Bugzilla.




      

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to