Skip to content

Commit

Permalink
Don't display svgs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed Nov 12, 2024
1 parent 28ec349 commit d8b1099
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/Core/Fileupload.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ public function displayImageFile(string $imageName, string $fullPath = ''): Resp
'jpeg' => 'image/jpg',
'gif' => 'image/gif',
'png' => 'image/png',
'svg' => 'image/svg+xml',
];

$responseFailure = new Response(file_get_contents(ROOT.'/dist/images/doc.png'));
Expand Down Expand Up @@ -388,7 +387,7 @@ public function displayImageFile(string $imageName, string $fullPath = ''): Resp
$path_parts = pathinfo($fullPath);
$ext = $path_parts['extension'];

if (! in_array($ext, ['jpg', 'jpeg', 'gif', 'png', 'svg'])) {
if (! in_array($ext, ['jpg', 'jpeg', 'gif', 'png'])) {
throw new HttpResponseException($responseFailure);
}

Expand Down

0 comments on commit d8b1099

Please sign in to comment.