From: Magnus Manske Date: Thu, 4 May 2006 09:41:33 +0000 (+0000) Subject: Fixed namespace handling (will now accept English namespace names in addition to... X-Git-Tag: 1.31.0-rc.0~57251 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=cc38d6d321374849590434d4a648ef0ef9fdf01a;p=lhc%2Fweb%2Fwiklou.git Fixed namespace handling (will now accept English namespace names in addition to localized ones) --- diff --git a/includes/SpecialRandompage.php b/includes/SpecialRandompage.php index cf6ecc03b7..9d38abcb39 100644 --- a/includes/SpecialRandompage.php +++ b/includes/SpecialRandompage.php @@ -11,14 +11,12 @@ * used as e.g. Special:Randompage/Category */ function wfSpecialRandompage( $par = NS_MAIN ) { - global $wgOut, $wgExtraRandompageSQL, $wgContLang; + global $wgOut, $wgExtraRandompageSQL, $wgContLang, $wgLang; $fname = 'wfSpecialRandompage'; - # Determine the namespace to get a random page from. - $namespace = $wgContLang->getNsIndex($par); - if ($namespace === false || $namespace < NS_MAIN) { - $namespace = NS_MAIN; - } + # Determine namespace + $t = Title::newFromText ( $par . ":Dummy" ) ; + $namespace = $t->getNamespace () ; # NOTE! We use a literal constant in the SQL instead of the RAND() # function because RAND() will return a different value for every row