Instead of manually building the <a> tag, use LinkRenderer to create it.
Change-Id: Iaefe85527307a8399e9f52dde58fb2c24c4753c2
' ' => '',
'x' => 'X',
] );
- $titleObj = SpecialPage::getTitleFor( 'Booksources', $num );
- return '<a href="' .
- htmlspecialchars( $titleObj->getLocalURL() ) .
- "\" class=\"internal mw-magiclink-isbn\">ISBN $isbn</a>";
+ return $this->getLinkRenderer()->makeKnownLink(
+ SpecialPage::getTitleFor( 'Booksources', $num ),
+ "ISBN $isbn",
+ [
+ 'class' => 'internal mw-magiclink-isbn',
+ 'title' => false // suppress title attribute
+ ]
+ );
} else {
return $m[0];
}