mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Fixed thumbnail for SVG files where the original name had no svg extension
This commit is contained in:
parent
05e9b63f89
commit
eb30fb6e83
1 changed files with 4 additions and 1 deletions
|
@ -135,7 +135,10 @@ class AttachmentURLGenerator
|
||||||
}
|
}
|
||||||
|
|
||||||
//GD can not work with SVG, so serve it directly...
|
//GD can not work with SVG, so serve it directly...
|
||||||
if ('svg' === $attachment->getExtension()) {
|
//We can not use getExtension here, because it uses the original filename and not the real extension
|
||||||
|
//Instead we use the logic, which is also used to determine if the attachment is a picture
|
||||||
|
$extension = pathinfo(parse_url($attachment->getPath(), PHP_URL_PATH) ?? '', PATHINFO_EXTENSION);
|
||||||
|
if ('svg' === $extension) {
|
||||||
return $this->assets->getUrl($asset_path);
|
return $this->assets->getUrl($asset_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue