dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
31f3e76
)
Make RandomInCat work for cats starting with namespace
author
Brian Wolff
<bawolff+wn@gmail.com>
Fri, 23 Aug 2013 20:02:49 +0000
(13:02 -0700)
committer
Brian Wolff
<bawolff+wn@gmail.com>
Fri, 23 Aug 2013 20:02:49 +0000
(13:02 -0700)
So if someone has Category:User:Foo, they can go to
both Special:RandomInCategory/Category:User:Foo, or
just Special:RandomInCategory/User:Foo.
Bug: 53239
Change-Id: I2e67f0463b725ce297eeb5a5de73ccbad826907a
includes/specials/SpecialRandomInCategory.php
patch
|
blob
|
history
diff --git
a/includes/specials/SpecialRandomInCategory.php
b/includes/specials/SpecialRandomInCategory.php
index
2e4bf20
..
fd554e6
100644
(file)
--- a/
includes/specials/SpecialRandomInCategory.php
+++ b/
includes/specials/SpecialRandomInCategory.php
@@
-76,6
+76,11
@@
class SpecialRandomInCategory extends SpecialPage {
$cat = Title::newFromText( $categoryStr, NS_CATEGORY );
}
+ if ( $cat && $cat->getNamespace() !== NS_CATEGORY ) {
+ // Someone searching for something like "Wikipedia:Foo"
+ $cat = Title::makeTitleSafe( NS_CATEGORY, $categoryStr );
+ }
+
if ( $cat ) {
$this->setCategory( $cat );
}