| Conditions | 8 |
| Paths | 8 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | function getPost(string $name, string $fallback = null, int $flag = POST_DEFAULT_FLAG) |
||
| 16 | { |
||
| 17 | if (isPost()) { |
||
| 18 | if (isset($_POST[$name])) { |
||
| 19 | $thePost = $_POST[$name]; |
||
| 20 | if ($flag != POST_DEFAULT_FLAG) { |
||
| 21 | if ($flag == POST_NOT_NULL) { |
||
| 22 | if ($thePost != null) return $thePost; |
||
| 23 | } else if ($flag == POST_NOT_EMPTY) { |
||
| 24 | if (!empty($thePost)) return $thePost; |
||
| 25 | } |
||
| 26 | } else { |
||
| 27 | return $thePost; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | } |
||
| 31 | return $fallback; |
||
|
|
|||
| 32 | } |
||
| 65 |