From bea68786740782ed7eb09dc24fc2a6c22ad74fb5 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Fri, 28 Aug 2015 00:23:18 +0300 Subject: [PATCH] SpecialVersion: Force text credits and license to LTR direction It's safe to assume that text files with credits or licenses are written in English, so it should be explicitly set to English/LTR so that English won't appear in RTL wikis as RTL. Change-Id: Ic9db006b2d3509de32f01ae04782535ab0183993 --- includes/specials/SpecialVersion.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 500a931d40..38baf5b953 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -92,7 +92,14 @@ class SpecialVersion extends SpecialPage { if ( $file ) { $wikiText = file_get_contents( $file ); if ( substr( $file, -4 ) === '.txt' ) { - $wikiText = Html::element( 'pre', array(), $wikiText ); + $wikiText = Html::element( + 'pre', + array( + 'lang' => 'en', + 'dir' => 'ltr', + ), + $wikiText + ); } } } @@ -109,7 +116,14 @@ class SpecialVersion extends SpecialPage { $file = $this->getExtLicenseFileName( dirname( $extNode['path'] ) ); if ( $file ) { $wikiText = file_get_contents( $file ); - $wikiText = "
$wikiText
"; + $wikiText = Html::element( + 'pre', + array( + 'lang' => 'en', + 'dir' => 'ltr', + ), + $wikiText + ); } } -- 2.20.1