Skip to content

Commit

Permalink
fix: patch up empty form error (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko authored Nov 10, 2024
1 parent af0dba3 commit c0553e5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ public static function input(bool $safeData = true)
$d = $data;
$data = [];

foreach (explode('&', $d) as $chunk) {
$param = explode('=', $chunk);
$data[$param[0]] = urldecode($param[1]);
if ($d) {
foreach (explode('&', $d) as $chunk) {
$param = explode('=', $chunk);
$data[$param[0]] = urldecode($param[1]);
}
}
} else if (strpos($contentType, 'application/json') !== 0 && strpos($contentType, 'multipart/form-data') !== 0) {
$safeData = false;
Expand Down

0 comments on commit c0553e5

Please sign in to comment.