Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't attempt to create thumbnail if file is SVG #70

Open
wants to merge 1 commit into
base: pThumb-dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/components/phpthumbof/model/phpthumbof.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
Expand Down