| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2.032 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | 2 | public static function sanitize(?string $input): ?string |
|
| 17 | { |
||
| 18 | 2 | if ($input === null) { |
|
| 19 | return null; |
||
| 20 | } |
||
| 21 | |||
| 22 | // Удаляем управляющие символы, кроме: табуляция (\x09), \n (\x0A), \r (\x0D) |
||
| 23 | 2 | $input = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F]/u', '', $input); |
|
| 24 | |||
| 25 | 2 | return $input; |
|
| 26 | } |
||
| 28 |