From: Brion Vibber Date: Sat, 14 Aug 2004 08:57:51 +0000 (+0000) Subject: * Use WebRequest::getInt() X-Git-Tag: 1.5.0alpha1~2370 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=77b62e09d03d103cd00975321fcbe23534ac9f3b;p=lhc%2Fweb%2Fwiklou.git * Use WebRequest::getInt() * Check that the namespace actually exists before trying to use it --- diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index e2a2893597..8841e2b18b 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -6,10 +6,12 @@ function wfSpecialAllpages( $par=NULL ) $indexMaxperpage = 480; $toplevelMaxperpage = 50; $from = $wgRequest->getVal( 'from' ); - $namespace = $wgRequest->getVal( 'namespace' ); - if ( is_null($namespace) ) { $namespace = 0; } - $arr = $wgLang->getNamespaces(); - $wgOut->setPagetitle ( $namespace > 0 ? wfMsg ( 'allpagesnamespace', $arr[$namespace] ) + $namespace = $wgRequest->getInt( 'namespace' ); + $names = $wgLang->getNamespaces(); + if( !isset( $names[$namespace] ) ) { + $namespace = 0; + } + $wgOut->setPagetitle ( $namespace > 0 ? wfMsg ( 'allpagesnamespace', $names[$namespace] ) : wfMsg ( 'allarticles' ) ); if ( $par ) {