mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-01 21:47:54 +09:00
Throw error if image doesn't have an extension #1446
This commit is contained in:
@@ -250,6 +250,9 @@ class ItemController extends Controller
|
|||||||
|
|
||||||
$file = $request->input('icon');
|
$file = $request->input('icon');
|
||||||
$path_parts = pathinfo($file);
|
$path_parts = pathinfo($file);
|
||||||
|
if (!isset($path_parts['extension'])) {
|
||||||
|
throw ValidationException::withMessages(['file' => 'Icon URL must have a valid file extension.']);
|
||||||
|
}
|
||||||
$extension = $path_parts['extension'];
|
$extension = $path_parts['extension'];
|
||||||
|
|
||||||
$contents = file_get_contents($request->input('icon'), false, stream_context_create($options));
|
$contents = file_get_contents($request->input('icon'), false, stream_context_create($options));
|
||||||
|
|||||||
Reference in New Issue
Block a user