Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
FileImporterUtils
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 addTargetBlankToLinks
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace FileImporter;
4
5/**
6 * @license GPL-2.0-or-later
7 */
8class FileImporterUtils {
9
10    public static function addTargetBlankToLinks( string $html ): string {
11        return preg_replace( '/<a\b(?![^<>]*\starget=)/i', '<a target="_blank"', $html );
12    }
13
14}