25use Wikimedia\RemexHtml\Serializer\SerializerNode;
36 private static function openLinksInNewWindow(
string &$html ):
void {
37 $html = HtmlHelper::modifyElements(
39 static function ( SerializerNode $node ):
bool {
40 return $node->name ===
'a'
41 && isset( $node->attrs[
'href'] )
42 && !str_contains( $node->attrs[
'class'] ??
'',
'mw-authentication-popup-link' );
44 static function ( SerializerNode $node ): SerializerNode {
45 $node->attrs[
'target'] ??=
'_blank';
52 $data = parent::getTemplateData();
56 self::openLinksInNewWindow( $data[
'html-body-content'] );
57 foreach ( $data[
'data-footer'] as &$footerItems ) {
58 foreach ( $footerItems[
'array-items'] as &$item ) {
59 self::openLinksInNewWindow( $item[
'html'] );
69class_alias( SkinAuthenticationPopup::class,
'SkinAuthenticationPopup' );