Filter out null external link attributes

Follows up If4880e4e0b3cd2056521d44baf261ed848511bcd.

Bug: T357668
Change-Id: Ifec733a923f193b72eaba9a1e604ad4e56c0aef2
This commit is contained in:
Gergő Tisza 2024-02-15 21:22:28 +00:00 committed by Brennen Bearnes
parent 466e3ce2ec
commit e6917c3b41

View file

@ -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';