Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function Sanitize($str, $remove_nl = true) |
||
24 | { |
||
25 | if (($str == '')) { |
||
26 | return ''; |
||
27 | } |
||
28 | |||
29 | $str = stripslashes($str); |
||
30 | |||
31 | if ($remove_nl) { |
||
32 | $injections = array( |
||
33 | '/(\n+)/i', |
||
34 | '/(\r+)/i', |
||
35 | '/(\t+)/i', |
||
36 | '/(%0A+)/i', |
||
37 | '/(%0D+)/i', |
||
38 | '/(%08+)/i', |
||
39 | '/(%09+)/i', |
||
40 | ); |
||
41 | |||
42 | $str = preg_replace($injections, '', $str); |
||
43 | } |
||
44 | |||
45 | return $str; |
||
46 | } |
||
65 |