$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 ) {
$frombox = '<input type="text" size="20" name="from" value="'
. htmlspecialchars ( $from ) . '"/>';
- $submitbutton = '<input type="submit" value="' . wfMsg( 'go' ) . '" />';
+ $submitbutton = '<input type="submit" value="' . wfMsg( 'allpagessubmit' ) . '" />';
$out = "<div class='namespaceselector'><form method='get' action='{$wgScript}'>";
$out .= '<input type="hidden" name="title" value="'.$t->getPrefixedText().'" />';
$fname = "indexShowToplevel";
$namespace = intval ($namespace);
- # Cache
- $vsp = $wgLang->getValidSpecialPages();
- $log = new LogPage( $vsp["Allpages"] );
- $log->mUpdateRecentChanges = false;
-
- global $wgMiserMode;
- if ( $wgMiserMode ) {
- $log->showAsDisabledPage();
- return;
- }
+ # TODO: Either make this *much* faster or cache the title index points
+ # in the querycache table.
$dbr =& wfGetDB( DB_SLAVE );
$cur = $dbr->tableName( 'cur' );
$out2 = $nsForm . '<hr />';
}
- # Saving cache
- $log->replaceContent( $out );
-
$wgOut->addHtml( $out2 . $out );
}
$sk = $wgUser->getSkin();
$dbr =& wfGetDB( DB_SLAVE );
- $inpointf = str_replace( "_", " ", $inpoint );
- $outpointf = str_replace( "_", " ", $outpoint );
- $queryparams = 'from=' . $dbr->strencode( $inpoint );
- if ( $namespace > 0 ) { $queryparams .= '&namespace='.intval($namespace); }
+ $inpointf = htmlspecialchars( str_replace( "_", " ", $inpoint ) );
+ $outpointf = htmlspecialchars( str_replace( "_", " ", $outpoint ) );
+ $queryparams = $namespace ? ('namespace='.intval($namespace)) : '';
+ $special = Title::makeTitle( NS_SPECIAL, 'Allpages/' . $inpoint );
+ $link = $special->escapeLocalUrl( $queryparams );
+
$out = wfMsg(
'alphaindexline',
- $sk->makeKnownLink( $wgLang->specialPage( "Allpages" ), $inpointf, $queryparams ) . '</td><td>',
- '</td><td align="left">' . $outpointf
+ "<a href=\"$link\">$inpointf</a></td><td><a href=\"$link\">",
+ "</a></td><td align=\"left\"><a href=\"$link\">$outpointf</a>"
);
return '<tr><td align="right">'.$out.'</td></tr>';
}