| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | private function insertIntoPostForms(ResponseInterface $response, $input) |
||
| 23 | { |
||
| 24 | $html = (string) $response->getBody(); |
||
| 25 | |||
| 26 | $html = preg_replace_callback( |
||
| 27 | '/(<form\s[^>]*method=["\']?POST["\']?[^>]*>)/i', |
||
| 28 | function ($match) use ($input) { |
||
| 29 | return $match[0].$input; |
||
| 30 | }, |
||
| 31 | $html, |
||
| 32 | -1, |
||
| 33 | $count |
||
| 34 | ); |
||
| 35 | |||
| 36 | if ($count) { |
||
|
|
|||
| 37 | $body = Middleware::createStream(); |
||
| 38 | $body->write($html); |
||
| 39 | |||
| 40 | return $response->withBody($body); |
||
| 41 | } |
||
| 42 | |||
| 43 | return $response; |
||
| 44 | } |
||
| 45 | |||
| 67 |
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: