From 8f416baead93a48e5799e44b8bd2e2c4859f4e04 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 14 Sep 2007 13:18:58 +0200 Subject: auf Version 1.11 aktualisiert; Login-Bug behoben --- includes/SpecialPrefixindex.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'includes/SpecialPrefixindex.php') diff --git a/includes/SpecialPrefixindex.php b/includes/SpecialPrefixindex.php index b7c51d49..6bb26d67 100644 --- a/includes/SpecialPrefixindex.php +++ b/includes/SpecialPrefixindex.php @@ -15,20 +15,14 @@ function wfSpecialPrefixIndex( $par=NULL, $specialPage ) { $from = $wgRequest->getVal( 'from' ); $prefix = $wgRequest->getVal( 'prefix' ); $namespace = $wgRequest->getInt( 'namespace' ); - $namespaces = $wgContLang->getNamespaces(); $indexPage = new SpecialPrefixIndex(); - if( !in_array($namespace, array_keys($namespaces)) ) - $namespace = 0; - - $wgOut->setPagetitle( $namespace > 0 ? - wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) : - wfMsg( 'allarticles' ) - ); - - + $wgOut->setPagetitle( ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces ) ) ) + ? wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) + : wfMsg( 'allarticles' ) + ); if ( isset($par) ) { $indexPage->showChunk( $namespace, $par, $specialPage->including(), $from ); @@ -67,9 +61,15 @@ function showChunk( $namespace = NS_MAIN, $prefix, $including = false, $from = n $fromList = $this->getNamespaceKeyAndText($namespace, $from); $prefixList = $this->getNamespaceKeyAndText($namespace, $prefix); + $namespaces = $wgContLang->getNamespaces(); + $align = $wgContLang->isRtl() ? 'left' : 'right'; if ( !$prefixList || !$fromList ) { $out = wfMsgWikiHtml( 'allpagesbadtitle' ); + } elseif ( !in_array( $namespace, array_keys( $namespaces ) ) ) { + // Show errormessage and reset to NS_MAIN + $out = wfMsgExt( 'allpages-bad-ns', array( 'parseinline' ), $namespace ); + $namespace = NS_MAIN; } else { list( $namespace, $prefixKey, $prefix ) = $prefixList; list( /* $fromNs */, $fromKey, $from ) = $fromList; @@ -127,8 +127,8 @@ function showChunk( $namespace = NS_MAIN, $prefix, $including = false, $from = n } else { $nsForm = $this->namespaceForm ( $namespace, $prefix ); $out2 = ''; - $out2 .= '
' . $nsForm; - $out2 .= '' . + $out2 .= '
' . $nsForm; + $out2 .= '' . $sk->makeKnownLink( $wgContLang->specialPage( $this->name ), wfMsg ( 'allpages' ) ); if ( isset($dbr) && $dbr && ($n == $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) { @@ -146,4 +146,4 @@ function showChunk( $namespace = NS_MAIN, $prefix, $including = false, $from = n } } -?> + -- cgit v1.2.2