From 77b62e09d03d103cd00975321fcbe23534ac9f3b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 14 Aug 2004 08:57:51 +0000 Subject: [PATCH] * Use WebRequest::getInt() * Check that the namespace actually exists before trying to use it --- includes/SpecialAllpages.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 ) { -- 2.20.1