* (bug 27761) Fix regression: pages with Esperanto titles containing convertible...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 1 Mar 2011 21:20:40 +0000 (21:20 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 1 Mar 2011 21:20:40 +0000 (21:20 +0000)
Fixes regression from r70871 -- a comparison originally made against the raw GET 'title' variable was changed to use WebRequest::getText() instead, which performs character conversion. This caused infinite redirect loops for titles containing convertible forms such as "ux", which in a recodable field would be round-tripped via "uxx".
This fix changes the comparison to use WebRequest::getVal(), restoring the original direct comparison and avoiding the redirect loops.

(Another nice reminder that this old system with the pseudo charset conversion is obsolete -- it should be replaced with a more modern browser-based input conversion that can apply to all text input fields.)

includes/Wiki.php

index 884156f..bf349cd 100644 (file)
@@ -201,7 +201,7 @@ class MediaWiki {
                        }
                // Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant
                } else if ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted()
-                       && ( $request->getVal( 'title' ) === null || $title->getPrefixedDBKey() != $request->getText( 'title' ) )
+                       && ( $request->getVal( 'title' ) === null || $title->getPrefixedDBKey() != $request->getVal( 'title' ) )
                        && !count( array_diff( array_keys( $request->getValues() ), array( 'action', 'title' ) ) ) )
                {
                        if ( $title->getNamespace() == NS_SPECIAL ) {