From 62cde15a7f58902d0ed8d24fb97d670ee17a391e Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 8 May 2013 18:20:07 +0200 Subject: [PATCH] Use Html::element() to build the links used in 'alphaindexline' message It makes the code more readable. Change-Id: I42e566188e826bd81881c83c069c9f75f5906d73 --- includes/specials/SpecialAllpages.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 98ec4f665c..a08204936a 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -308,8 +308,10 @@ class SpecialAllpages extends IncludableSpecialPage { function showline( $inpoint, $outpoint, $namespace = NS_MAIN, $hideRedirects = false ) { // Use content language since page titles are considered to use content language global $wgContLang; - $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) ); - $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) ); + + $inpointf = str_replace( '_', ' ', $inpoint ); + $outpointf = str_replace( '_', ' ', $outpoint ); + // Don't let the length runaway $inpointf = $wgContLang->truncate( $inpointf, $this->maxPageLength ); $outpointf = $wgContLang->truncate( $outpointf, $this->maxPageLength ); @@ -326,12 +328,13 @@ class SpecialAllpages extends IncludableSpecialPage { $queryParams['hideredirects'] = 1; } - $link = htmlspecialchars( - $this->getTitle()->getLocalURL( $queryParams ) ); + $url = $this->getTitle()->getLocalURL( $queryParams ); + $inlink = Html::element( 'a', array( 'href' => $url ), $inpointf ); + $outlink = Html::element( 'a', array( 'href' => $url ), $outpointf ); $out = $this->msg( 'alphaindexline' )->rawParams( - "$inpointf", - "$outpointf" + "$inlink", + "$outlink" )->escaped(); return '' . $out . ''; -- 2.20.1