| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | 7 | public static function clean( |
|
| 13 | string $html, |
||
| 14 | ?HtmlSanitizerConfig $config = null, |
||
| 15 | bool $removeEmptyLines = true, |
||
| 16 | ): string { |
||
| 17 | 7 | $config = $config ?: (new HtmlSanitizerConfig()) |
|
| 18 | 7 | // Allow "safe" elements and attributes. All scripts will be removed |
|
| 19 | 7 | // as well as other dangerous behaviors like CSS injection |
|
| 20 | 7 | ->allowSafeElements(); |
|
| 21 | 7 | $sanitizer = new HtmlSanitizer($config); |
|
| 22 | 7 | $result = $sanitizer->sanitize($html); |
|
| 23 | |||
| 24 | // also remove empty lines |
||
| 25 | 7 | return $removeEmptyLines ? |
|
| 26 | 7 | preg_replace("/(^[\r\n]*|[\r\n]+)[\\s\t]*[\r\n]+/", PHP_EOL, $result) : |
|
| 27 | 7 | $result; |
|
| 28 | } |
||
| 30 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths