* (bug 21364) External links using link= attribute on images now respect $wgExternalL...
[lhc/web/wiklou.git] / includes / media / MediaTransformOutput.php
index 276d254..c441f06 100644 (file)
@@ -144,6 +144,7 @@ class ThumbnailImage extends MediaTransformOutput {
         *     desc-query   String, description link query params
         *     custom-url-link    Custom URL to link to
         *     custom-title-link  Custom Title object to link to
+        *     custom target-link Value of the target attribute, for custom-target-link
         *
         * For images, desc-link and file-link are implemented as a click-through. For
         * sounds and videos, they may be displayed in other ways.
@@ -164,6 +165,9 @@ class ThumbnailImage extends MediaTransformOutput {
                        if ( !empty( $options['title'] ) ) {
                                $linkAttribs['title'] = $options['title'];
                        }
+                       if ( !empty( $options['custom-target-link'] ) ) {
+                               $linkAttribs['target'] = $options['custom-target-link'];
+                       }
                } elseif ( !empty( $options['custom-title-link'] ) ) {
                        $title = $options['custom-title-link'];
                        $linkAttribs = array(