(bug 17799) Special:Random no longer throws a database error when a non-namespace...
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 5 Mar 2009 13:38:17 +0000 (13:38 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 5 Mar 2009 13:38:17 +0000 (13:38 +0000)
RELEASE-NOTES
includes/specials/SpecialRandompage.php

index 87af9fe..35d484d 100644 (file)
@@ -239,6 +239,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 17761) "show/hide" link in page history in now works for the first
   displayed revision if it's not the current one
 * (bug 17722) Fix regression where users are unable to change temporary passwords
+* (bug 17799) Special:Random no longer throws a database error when a non-
+  namespace is given, silently falls back to NS_MAIN
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
index f4bff30..31199b2 100644 (file)
@@ -23,7 +23,7 @@ class RandomPage extends SpecialPage {
        }
 
        public function setNamespace ( $ns ) {
-               if( $ns < NS_MAIN ) $ns = NS_MAIN;
+               if( !$ns || $ns < NS_MAIN ) $ns = NS_MAIN;
                $this->namespaces = array( $ns );
        }