| Conditions | 5 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public static function escapeParamValue($value) |
||
| 15 | { |
||
| 16 | $count = 0; |
||
| 17 | $value = str_replace('\\', '\\\\', $value); |
||
| 18 | $value = str_replace('"', '\"', $value, $count); |
||
| 19 | $value = str_replace("\n", '\\n', $value); |
||
| 20 | |||
| 21 | if (false !== strpos($value, ';') || false !== strpos($value, ',') || false !== strpos($value, ':') || $count) { |
||
|
|
|||
| 22 | $value = '"' . $value . '"'; |
||
| 23 | } |
||
| 24 | |||
| 25 | return $value; |
||
| 26 | } |
||
| 27 | } |
||
| 28 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: