r82085 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82084‎ | r82085 | r82086 >
Date:22:19, 13 February 2011
Author:brion
Status:ok
Tags:
Comment:
* (bug 26856) Fix category tree AJAX expansion and inline use for category names that match namespace names ending in colon

The previous check that checked for the alt-namespace case caught things for 'Category:Wikipedia:Foo' but not for 'Category:Wikipedia:', where the 'Wikipedia:' alone doesn't return a legit title.
(Conceivably, Title::newFromText() should actually handle this case when an alt ns is given, should be examined later.)
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -765,7 +765,9 @@
766766 # The title must be in the category namespace
767767 # Ignore a leading Category: if there is one
768768 $t = Title::newFromText( $title, NS_CATEGORY );
769 - if ( $t && ( $t->getNamespace() != NS_CATEGORY || $t->getInterWiki() != '' ) ) {
 769+ if ( !$t || $t->getNamespace() != NS_CATEGORY || $t->getInterWiki() != '' ) {
 770+ // If we were given something like "Wikipedia:Foo" or "Template:",
 771+ // try it again but forced.
770772 $title = "Category:$title";
771773 $t = Title::newFromText( $title );
772774 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r821511.17wmf1: MFT r78964, r79086, r79087, r79091, r82004, r82025, r82048, r82070,...catrope22:55, 14 February 2011
r85027MFT various extension fixes: r81713, r81742, r81743, r81908, r81966, r81969, ...demon18:23, 30 March 2011

Status & tagging log