Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -4694,6 +4694,9 @@ |
4695 | 4695 | if ( preg_match( "/^($prots)$chars+$/", $value, $m ) ) { |
4696 | 4696 | $paramName = 'link-url'; |
4697 | 4697 | $this->mOutput->addExternalLink( $value ); |
| 4698 | + if ( $this->mOptions->getExternalLinkTarget() ) { |
| 4699 | + $params[$type]['link-target'] = $this->mOptions->getExternalLinkTarget(); |
| 4700 | + } |
4698 | 4701 | $validated = true; |
4699 | 4702 | } |
4700 | 4703 | } else { |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -428,6 +428,7 @@ |
429 | 429 | * caption HTML for image caption. |
430 | 430 | * link-url URL to link to |
431 | 431 | * link-title Title object to link to |
| 432 | + * link-target Value for the target attribue, only with link-url |
432 | 433 | * no-link Boolean, suppress description link |
433 | 434 | * |
434 | 435 | * @param $handlerParams Array: associative array of media handler parameters, to be passed |
— | — | @@ -552,6 +553,9 @@ |
553 | 554 | $mtoParams = array(); |
554 | 555 | if ( isset( $frameParams['link-url'] ) && $frameParams['link-url'] !== '' ) { |
555 | 556 | $mtoParams['custom-url-link'] = $frameParams['link-url']; |
| 557 | + if ( isset( $frameParams['link-target'] ) ) { |
| 558 | + $mtoParams['custom-target-link'] = $frameParams['link-target']; |
| 559 | + } |
556 | 560 | } elseif ( isset( $frameParams['link-title'] ) && $frameParams['link-title'] !== '' ) { |
557 | 561 | $mtoParams['custom-title-link'] = $this->normaliseSpecialPage( $frameParams['link-title'] ); |
558 | 562 | } elseif ( !empty( $frameParams['no-link'] ) ) { |
Index: trunk/phase3/includes/media/MediaTransformOutput.php |
— | — | @@ -144,6 +144,7 @@ |
145 | 145 | * desc-query String, description link query params |
146 | 146 | * custom-url-link Custom URL to link to |
147 | 147 | * custom-title-link Custom Title object to link to |
| 148 | + * custom target-link Value of the target attribute, for custom-target-link |
148 | 149 | * |
149 | 150 | * For images, desc-link and file-link are implemented as a click-through. For |
150 | 151 | * sounds and videos, they may be displayed in other ways. |
— | — | @@ -164,6 +165,9 @@ |
165 | 166 | if ( !empty( $options['title'] ) ) { |
166 | 167 | $linkAttribs['title'] = $options['title']; |
167 | 168 | } |
| 169 | + if ( !empty( $options['custom-target-link'] ) ) { |
| 170 | + $linkAttribs['target'] = $options['custom-target-link']; |
| 171 | + } |
168 | 172 | } elseif ( !empty( $options['custom-title-link'] ) ) { |
169 | 173 | $title = $options['custom-title-link']; |
170 | 174 | $linkAttribs = array( |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -410,6 +410,8 @@ |
411 | 411 | * (bug 13353) Diff3 version checks were too strict, did not detect working diff3 |
412 | 412 | * (bug 25843) Links to special pages using link= attribute on images are now |
413 | 413 | normalised like normal links to special pages |
| 414 | +* (bug 21364) External links using link= attribute on images now respect |
| 415 | + $wgExternalLinkTarget |
414 | 416 | |
415 | 417 | === API changes in 1.17 === |
416 | 418 | * (bug 22738) Allow filtering by action type on query=logevent. |