From 6d0f2e4d188683902d5ff86ff32595804e671274 Mon Sep 17 00:00:00 2001 From: Hugo Peek Date: Sun, 19 Sep 2021 20:07:27 +0800 Subject: [PATCH] Don't attempt to create thumbnail if file is SVG --- core/components/phpthumbof/model/phpthumbof.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/components/phpthumbof/model/phpthumbof.class.php b/core/components/phpthumbof/model/phpthumbof.class.php index 4e1141d..dff856a 100644 --- a/core/components/phpthumbof/model/phpthumbof.class.php +++ b/core/components/phpthumbof/model/phpthumbof.class.php @@ -158,7 +158,7 @@ public function debugmsg($msg, $phpthumbDebug = FALSE) { /* - * Create a thumnail from $src with $options + * Create a thumbnail from $src with $options * $src can be a path/filename or URL and absolute or relative * Returns the filename of the cached image on success or $src on failure */ @@ -175,6 +175,9 @@ public function createThumbnail($src, $options) { if ($this->config['cacheNotWritable']) { return $output; } + if (strtolower(pathinfo($src, PATHINFO_EXTENSION)) === 'svg') { // abort if file is SVG + return $output; + } /* Find input file */ $isRemote = preg_match('/^(?:https?:)?\/\/((?:.+?)\.(?:.+?))\/(.+)/i', $src, $matches); // check for absolute URLs if ($isRemote && $this->config['httpHost'] === strtolower($matches[1])) { // if it's the same server we're running on