diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2021-02-08 11:32:51 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2021-02-08 11:38:38 +0000 |
| commit | 78e8481f8b7c84f66568f41c47f613604c77081f (patch) | |
| tree | 1b5e5e7b1a097e451c0b775c8914fecb112bf4d5 /app | |
| parent | 8303bc5050fe56a4f0c28fcbfe3bb1c625076517 (diff) | |
| download | webtrees-78e8481f8b7c84f66568f41c47f613604c77081f.tar.gz webtrees-78e8481f8b7c84f66568f41c47f613604c77081f.tar.bz2 webtrees-78e8481f8b7c84f66568f41c47f613604c77081f.zip | |
Fix: #3499 - truncated file upload causes unhandled error
Diffstat (limited to 'app')
| -rw-r--r-- | app/Http/RequestHandlers/CreateMediaObjectAction.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/Http/RequestHandlers/CreateMediaObjectAction.php b/app/Http/RequestHandlers/CreateMediaObjectAction.php index 23256a08b4..6a8c2712e5 100644 --- a/app/Http/RequestHandlers/CreateMediaObjectAction.php +++ b/app/Http/RequestHandlers/CreateMediaObjectAction.php @@ -31,6 +31,7 @@ use Psr\Http\Server\RequestHandlerInterface; use function assert; use function in_array; +use function response; /** * Process a form to create a new media object. @@ -68,11 +69,11 @@ class CreateMediaObjectAction implements RequestHandlerInterface assert($tree instanceof Tree); $params = (array) $request->getParsedBody(); - $note = $params['media-note']; - $title = $params['title']; - $type = $params['type']; - $privacy_restriction = $params['privacy-restriction']; - $edit_restriction = $params['edit-restriction']; + $note = $params['media-note'] ?? ''; + $title = $params['title'] ?? ''; + $type = $params['type'] ?? ''; + $privacy_restriction = $params['privacy-restriction'] ?? ''; + $edit_restriction = $params['edit-restriction'] ?? ''; $file = $this->media_file_service->uploadFile($request); |
