Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
FileImporterUtils | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
addTargetBlankToLinks | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
<?php | |
namespace FileImporter; | |
/** | |
* @license GPL-2.0-or-later | |
*/ | |
class FileImporterUtils { | |
/** | |
* @param string $html | |
* | |
* @return string | |
*/ | |
public static function addTargetBlankToLinks( string $html ): string { | |
return preg_replace( '/<a\b(?![^<>]*\starget=)/i', '<a target="_blank"', $html ); | |
} | |
} |