Skip to content

Commit c0553e5

Browse files
authored
fix: patch up empty form error (#24)
1 parent af0dba3 commit c0553e5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Request.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ public static function input(bool $safeData = true)
103103
$d = $data;
104104
$data = [];
105105

106-
foreach (explode('&', $d) as $chunk) {
107-
$param = explode('=', $chunk);
108-
$data[$param[0]] = urldecode($param[1]);
106+
if ($d) {
107+
foreach (explode('&', $d) as $chunk) {
108+
$param = explode('=', $chunk);
109+
$data[$param[0]] = urldecode($param[1]);
110+
}
109111
}
110112
} else if (strpos($contentType, 'application/json') !== 0 && strpos($contentType, 'multipart/form-data') !== 0) {
111113
$safeData = false;

0 commit comments

Comments
 (0)