Merge "(bug 25277) Moved the space before the dirmark."
authorBrion VIBBER <brion@wikimedia.org>
Tue, 3 Apr 2012 04:18:40 +0000 (04:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 3 Apr 2012 04:18:40 +0000 (04:18 +0000)
includes/ImagePage.php

index b41e126..7453baa 100644 (file)
@@ -279,7 +279,7 @@ class ImagePage extends Article {
                $max = $wgImageLimits[$sizeSel];
                $maxWidth = $max[0];
                $maxHeight = $max[1];
-               $dirmark = $wgLang->getDirMark();
+               $dirmark = $wgLang->getDirMarkEntity();
 
                if ( $this->displayImg->exists() ) {
                        # image
@@ -449,14 +449,21 @@ class ImagePage extends Article {
 
                                if ( !$this->displayImg->isSafeFile() ) {
                                        $warning = wfMsgNoTrans( 'mediawarning' );
+                                       // dirmark is needed here to separate the file name, which
+                                       // most likely ends in Latin characters, from the description,
+                                       // which may begin with the file type. In RTL environment
+                                       // this will get messy.
+                                       // The dirmark, however, must not be immediately adjacent
+                                       // to the filename, because it can get copied with it.
+                                       // See bug 25277.
                                        $wgOut->addWikiText( <<<EOT
-<div class="fullMedia"><span class="dangerousLink">{$medialink}</span>$dirmark <span class="fileInfo">$longDesc</span></div>
+<div class="fullMedia"><span class="dangerousLink">{$medialink}</span> $dirmark<span class="fileInfo">$longDesc</span></div>
 <div class="mediaWarning">$warning</div>
 EOT
                                                );
                                } else {
                                        $wgOut->addWikiText( <<<EOT
-<div class="fullMedia">{$medialink}{$dirmark} <span class="fileInfo">$longDesc</span>
+<div class="fullMedia">{$medialink} {$dirmark}<span class="fileInfo">$longDesc</span>
 </div>
 EOT
                                        );