mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ImageMap
synced 2024-11-13 17:36:54 +00:00
Filter out null external link attributes
Follows up If4880e4e0b3cd2056521d44baf261ed848511bcd. Bug: T357668 Change-Id: Ifec733a923f193b72eaba9a1e604ad4e56c0aef2
This commit is contained in:
parent
466e3ce2ec
commit
e6917c3b41
|
@ -247,7 +247,10 @@ class ImageMap implements ParserFirstCallInitHook {
|
|||
$attribs = [];
|
||||
if ( $externLink ) {
|
||||
// Get the 'target' and 'rel' attributes for external link.
|
||||
$attribs = $parser->getExternalLinkAttribs( $title );
|
||||
$attribs = array_filter(
|
||||
$parser->getExternalLinkAttribs( $title ),
|
||||
fn ( $attr ) => $attr !== null
|
||||
);
|
||||
|
||||
$attribs['href'] = $title;
|
||||
$attribs['class'] = 'plainlinks';
|
||||
|
|
Loading…
Reference in a new issue