Total Complexity | 1 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
16 | trait StringSanitizerTrait |
||
17 | { |
||
18 | /** |
||
19 | * @var array<string, string> |
||
20 | */ |
||
21 | private static $replacements = [ |
||
22 | // Some DB engines will transform UTF8 full-width characters their classical version |
||
23 | // if the data is saved in a non-UTF8 field |
||
24 | '<' => '<', |
||
25 | '>' => '>', |
||
26 | '+' => '+', |
||
27 | '=' => '=', |
||
28 | '@' => '@', |
||
29 | '`' => '`', |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * @param string $string |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | 10 | public function encodeHtmlEntities(string $string): string |
|
45 |