Skip to content

Commit

Permalink
Fixed validation of SmartFigure source URLs
Browse files Browse the repository at this point in the history
4ff247f introduced a regression in the validation for adding a source URL
to a SmartFigure: where either a URL or file upload used to be required,
now a file upload had to be present if a URL was to be set.
This commit reverts the behavior back to requiring a URL or a file.
  • Loading branch information
eidens committed May 2, 2023
1 parent be50a8a commit 86fe0f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Controllers/API/FileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public function store(Panel $panel, Request $request)
$maxFileSizeInMB = 4;
$maxFileSizeInBytes = 4 * 1000;
$rules = [
'file' => ['required', 'mimes:jpeg,png,jpg,gif,pdf,tif', "max:$maxFileSizeInBytes"],
'file' => ['required_without:url', 'mimes:jpeg,png,jpg,gif,pdf,tif', "max:$maxFileSizeInBytes"],
'url' => ['required_without:file', 'url']
];
$messages = [
'file.max' => "Source files may not be larger than $maxFileSizeInMB MB",
Expand Down

0 comments on commit 86fe0f6

Please sign in to comment.