Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | public static function escape($string, $preserveEntities = false) |
||
29 | { |
||
30 | if ($preserveEntities) { |
||
31 | $string = preg_replace('/[&](?![#](x[a-f0-9]{1,8}|[0-9]{1,8});|[a-z][a-z0-9]{1,31};)/i', '&', $string); |
||
32 | } else { |
||
33 | $string = str_replace('&', '&', $string); |
||
34 | } |
||
35 | |||
36 | return str_replace(['<', '>', '"'], ['<', '>', '"'], $string); |
||
37 | } |
||
38 | } |
||
39 |