From: Amir E. Aharoni Date: Thu, 27 Aug 2015 21:23:18 +0000 (+0300) Subject: SpecialVersion: Force text credits and license to LTR direction X-Git-Tag: 1.31.0-rc.0~10229^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=bea68786740782ed7eb09dc24fc2a6c22ad74fb5;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 + ); } }