From: Aaron Schulz Date: Sun, 17 Aug 2008 00:39:46 +0000 (+0000) Subject: truncate super long pages (bug 15186) X-Git-Tag: 1.31.0-rc.0~45859 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=df59b957acb4d14d84a887af6036054a12fd7067;hp=8266bb1b1d7338e240f871469237ee2180bcc896;p=lhc%2Fweb%2Fwiklou.git truncate super long pages (bug 15186) --- 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" );