Explicit variable definition, tweak documentation
[lhc/web/wiklou.git] / includes / Linker.php
index 92765b8..476878e 100644 (file)
@@ -313,7 +313,7 @@ class Linker {
                        return '';
                }
 
-               # If the target is just a fragment, with no title, we return the frag-
+               # If the target is just a fragment, with no title, we return the frag-
                # ment text.  Otherwise, we return the title text itself.
                if ( $target->getPrefixedText() === '' and $target->getFragment() !== '' ) {
                        return htmlspecialchars( $target->getFragment() );
@@ -428,6 +428,7 @@ class Linker {
         *          caption         HTML for image caption.
         *          link-url        URL to link to
         *          link-title      Title object to link to
+        *          link-target     Value for the target attribue, only with link-url
         *          no-link         Boolean, suppress description link
         *
         * @param $handlerParams Array: associative array of media handler parameters, to be passed
@@ -552,8 +553,11 @@ class Linker {
                $mtoParams = array();
                if ( isset( $frameParams['link-url'] ) && $frameParams['link-url'] !== '' ) {
                        $mtoParams['custom-url-link'] = $frameParams['link-url'];
+                       if ( isset( $frameParams['link-target'] ) ) {
+                               $mtoParams['custom-target-link'] = $frameParams['link-target'];
+                       }
                } elseif ( isset( $frameParams['link-title'] ) && $frameParams['link-title'] !== '' ) {
-                       $mtoParams['custom-title-link'] = $frameParams['link-title'];
+                       $mtoParams['custom-title-link'] = $this->normaliseSpecialPage( $frameParams['link-title'] );
                } elseif ( !empty( $frameParams['no-link'] ) ) {
                        // No link
                } else {