r47219 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47218‎ | r47219 | r47220 >
Date:17:50, 13 February 2009
Author:ialex
Status:reverted (Comments)
Tags:
Comment:
bug 17477 and fix for r47196: Don't use global $title; this can work when executing index.php, but fails horribly in maintenance scripts (breaking checkBadRedirects.php at least)
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -571,8 +571,8 @@
572572 return $this->getNsTextInternal( $this->mNamespace );
573573 }
574574
575 - function getNsTextInternal( $namespace) {
576 - global $wgContLang, $wgSlowGenderAliases, $wgTitle, $title;
 575+ function getNsTextInternal( $namespace ) {
 576+ global $wgContLang, $wgRequest, $wgTitle, $wgSlowGenderAliases;
577577 if( $namespace === NS_USER || $namespace === NS_USER_TALK ) {
578578 static $gender = null;
579579
@@ -581,13 +581,13 @@
582582 $gender[$name] = User::getDefaultOption( 'gender' );
583583
584584 // wgTitle may not be defined
585 - $mytitle = isset($wgTitle) ? $wgTitle: Title::newFromText($title);
 585+ $mytitle = isset( $wgTitle ) ? $wgTitle : Title::newFromText( $wgRequest->getVal( 'title' ) );
586586
587587 // Check stuff
588588 if ( $wgSlowGenderAliases ||
589589 // Needs to be checked always to produce desired
590590 // effect when viewing user pages
591 - ($mytitle && $name === $mytitle->getBaseText()) ) {
 591+ ( $mytitle && $name === $mytitle->getBaseText() ) ) {
592592
593593 $user = User::newFromName( $name );
594594 if ( $user ) $gender[$name] = $user->getOption( 'gender' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r47391Revert r47196, r47219 "* (bug 13040) Gender-aware user namespace aliases" and...brion23:00, 17 February 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r47196* (bug 13040) Gender-aware user namespace aliases...nikerabbit19:54, 12 February 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   22:55, 17 February 2009

Why is this code hitting $wgTitle to begin with? It looks completely nonsensical.

#Comment by Brion VIBBER (talk | contribs)   23:01, 17 February 2009

Reverted along with original in r47391

Status & tagging log