Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
19 | 2 | public function process(MinifyContext $context) |
|
20 | { |
||
21 | 2 | $contents = preg_replace_callback( |
|
22 | '/'. |
||
23 | 2 | Constants::$htmlEventNamePrefix.Constants::ATTRIBUTE_NAME_REGEX.' # Match an on{attribute} |
|
24 | \s*=\s* # Match equals sign with optional whitespaces around it |
||
25 | ["\']? # Match an optional quote |
||
26 | \s*javascript: # Match the text "javascript:" which should be removed |
||
27 | /xis', |
||
28 | 2 | function ($match) { |
|
29 | 1 | return str_replace('javascript:', '', $match[0]); |
|
30 | 2 | }, $context->getContents()); |
|
31 | |||
32 | 2 | return $context->setContents($contents); |
|
33 | } |
||
34 | |||
45 |