File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public function match(string $input): array
2828 }
2929 $ matches = [];
3030 preg_match_all (
31- $ this ->getPatternForCurrentPhpVersion (),
31+ $ this ->getPattern (),
3232 $ input ,
3333 $ matches
3434 );
@@ -47,18 +47,11 @@ public function match(string $input): array
4747 /**
4848 * @return string
4949 */
50- protected function getPatternForCurrentPhpVersion (): string
50+ protected function getPattern (): string
5151 {
52- if (version_compare (phpversion (), '7.3 ' , '> ' )) {
53- return '/<script[\/\s\w\-="]*src= ' . $ this ->resourcePattern . '[^>]*> '
54- . '| ' .
55- '<link[\/\s\w\-="]*href= ' . $ this ->resourcePattern . '[^>]*> '
56- . '/ui ' ;
57- } else {
58- return '/<script[\/\s\w-="]*src= ' . $ this ->resourcePattern . '[^>]*> '
59- . '| ' .
60- '<link[\/\s\w-="]*href= ' . $ this ->resourcePattern . '[^>]*> '
61- . '/ui ' ;
62- }
52+ return '/<script[\/\s\w\-="]*src= ' . $ this ->resourcePattern . '[^>]*> '
53+ . '| ' .
54+ '<link[\/\s\w\-="]*href= ' . $ this ->resourcePattern . '[^>]*> '
55+ . '/ui ' ;
6356 }
6457}
You can’t perform that action at this time.
0 commit comments