From df59b957acb4d14d84a887af6036054a12fd7067 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 17 Aug 2008 00:39:46 +0000 Subject: [PATCH] truncate super long pages (bug 15186) --- includes/specials/SpecialAllpages.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 13d988de8e..13a6ab0196 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -48,6 +48,11 @@ class SpecialAllpages { * Maximum number of pages to show on single index subpage. */ protected $maxLineCount = 200; + + /** + * Maximum number of chars to show for an entry. + */ + protected $maxPageLength = 70; /** * Name of this special page. Used to make title objects that reference back @@ -225,12 +230,15 @@ function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) { $align = $wgContLang->isRtl() ? 'left' : 'right'; $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) ); $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) ); + // Don't let the length runaway + $inpointf = $wgContLang->truncate( $inpointf, $this->maxPageLength, '...' ); + $outpointf = $wgContLang->truncate( $outpointf, $this->maxPageLength, '...' ); + $queryparams = $namespace ? "namespace=$namespace&" : ''; $special = SpecialPage::getTitleFor( $this->name ); $link = $special->escapeLocalUrl( $queryparams . 'from=' . urlencode($inpoint) . '&to=' . urlencode($outpoint) ); - $out = wfMsgHtml( - 'alphaindexline', + $out = wfMsgHtml( 'alphaindexline', "$inpointf", "$outpointf" ); -- 2.20.1