foo,bar@example,com
* (bug 20176) Fix login/logout links in skin CologneBlue
* (bug 20203) "Powered by Mediawiki" now has height/width on image tag
+* (bug 20273) Fix broken output when no pages are found in the content
+ namespaces
== API changes in 1.16 ==
class RandomPage extends SpecialPage {
private $namespaces; // namespaces to select pages from
- function __construct( $name = 'Randompage' ){
+ public function __construct( $name = 'Randompage' ){
global $wgContentNamespaces;
-
$this->namespaces = $wgContentNamespaces;
-
parent::__construct( $name );
}
if( is_null( $title ) ) {
$this->setHeaders();
- $wgOut->addWikiMsg( strtolower( $this->mName ) . '-nopages', $wgContLang->getNsText( $this->namespace ) );
+ $wgOut->addWikiMsg( strtolower( $this->mName ) . '-nopages',
+ $this->getNsList(), count( $this->namespaces ) );
return;
}
$wgOut->redirect( $title->getFullUrl( $query ) );
}
+ /**
+ * Get a comma-delimited list of namespaces we don't have
+ * any pages in
+ * @return String
+ */
+ private function getNsList() {
+ global $wgContLang;
+ $nsNames = array();
+ foreach( $this->namespaces as $n ) {
+ if( $n === NS_MAIN )
+ $nsNames[] = wfMsgForContent( 'blanknamespace' );
+ else
+ $nsNames[] = $wgContLang->getNsText( $n );
+ }
+ return $wgContLang->commaList( $nsNames );
+ }
+
/**
* Choose a random title.
# Random page
'randompage' => 'Random page',
-'randompage-nopages' => 'There are no pages in the namespace "$1".',
+'randompage-nopages' => 'There are no pages in the following {{PLURAL:$2|namespace|namespaces}}: $1.',
'randompage-url' => 'Special:Random', # do not translate or duplicate this message to other languages
# Random redirect