r70871 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70870‎ | r70871 | r70872 >
Date:12:15, 11 August 2010
Author:demon
Status:resolved (Comments)
Tags:
Comment:
Remove raw $_GET usage held over from days before WebRequest existed, was introduced in r12605
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -5,14 +5,10 @@
66 * @internal documentation reviewed 15 Mar 2010
77 */
88 class MediaWiki {
9 -
10 - var $GET; /* Stores the $_GET variables at time of creation, can be changed */
119 var $params = array();
1210
13 - /** Constructor. It just save the $_GET variable */
14 - function __construct() {
15 - $this->GET = $_GET;
16 - }
 11+ /** Constructor */
 12+ function __construct() {}
1713
1814 /**
1915 * Stores key/value pairs to circumvent global variables
@@ -214,11 +210,11 @@
215211 }
216212 // Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant
217213 } else if( $action == 'view' && !$request->wasPosted() &&
218 - ( ( !isset($this->GET['title']) || $title->getPrefixedDBKey() != $this->GET['title'] ) ||
 214+ ( ( !$request->getVal( 'title' ) || $title->getPrefixedDBKey() != $request->getText( 'title' ) ) ||
219215 // No valid variant in URL (if the main-language has multi-variants), to ensure
220216 // anonymous access would always be redirect to a URL with 'variant' parameter
221 - ( !isset($this->GET['variant']) && $wgContLang->hasVariants() && !$wgUser->isLoggedIn() ) ) &&
222 - !count( array_diff( array_keys( $this->GET ), array( 'action', 'title' ) ) ) )
 217+ ( !$request->getVal( 'variant' ) && $wgContLang->hasVariants() && !$wgUser->isLoggedIn() ) ) &&
 218+ !count( array_diff( array_keys( $request->getValues() ), array( 'action', 'title' ) ) ) )
223219 {
224220 if( !$wgUser->isLoggedIn() ) {
225221 $pref = $wgContLang->getPreferredVariant( false, $fromHeader = true );

Follow-up revisions

RevisionCommit summaryAuthorDate
r76436Fix for r70871: need explicit check against null since current check also cat...ialex08:28, 10 November 2010
r83046* (bug 27761) Fix regression: pages with Esperanto titles containing converti...brion21:20, 1 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r12605Moving more stuffmagnus_manske12:56, 11 January 2006

Comments

#Comment by Catrope (talk | contribs)   20:16, 7 December 2010
+	/** Constructor */
+	function __construct() {}

This isn't needed, right?

#Comment by 😂 (talk | contribs)   20:48, 7 December 2010

Yeah probably not :p

#Comment by Brion VIBBER (talk | contribs)   21:13, 1 March 2011

Triggers regression bugzilla:27761.

Looks like this is due to switching from $this->GET['title'] to $request->getText('title') -- request->getText() runs through charset conversion, which gets the old-fashioned Esperanto conversion (and anything else using the related systems, if anything's left).

#Comment by Brion VIBBER (talk | contribs)   21:21, 1 March 2011

Regression is fixed by r83046 on trunk. Needs 1.17wmf1 merge and deployment to fix the live bug.

Status & tagging log