Skip to content

Commit

Permalink
Allow empty file names (#7)
Browse files Browse the repository at this point in the history
Without this, if a file input is present in a form, but no file is uploaded,
an error is triggered.
  • Loading branch information
evll authored and kelunik committed Dec 13, 2019
1 parent 2a8fadd commit f263137
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BufferingParser.php
Expand Up @@ -105,7 +105,7 @@ private function parseBody(string $body, string $boundary = null): Form
$entry = \substr($entry, $position + 4);

$count = \preg_match(
'#^\s*form-data(?:\s*;\s*(?:name\s*=\s*"([^"]+)"|filename\s*=\s*"([^"]+)"))+\s*$#',
'#^\s*form-data(?:\s*;\s*(?:name\s*=\s*"([^"]+)"|filename\s*=\s*"([^"]*)"))+\s*$#',
$headers["content-disposition"][0] ?? "",
$matches
);
Expand Down

0 comments on commit f263137

Please sign in to comment.