From 7d2486c54678d7e6da2ec80411edba5bb8b5a5b7 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Sat, 6 Apr 2019 15:45:17 +0200 Subject: [PATCH] ImageMinify: Prevent undefined variable error If the given imagefile is not one of the defaults (png/jpg/gif/svg) and no minifier was passed to the ImageMinify task a warning for an undefined variable is show. Prevent this by setting an empty string to the beginning of the file check. Refs #852 --- src/Task/Assets/ImageMinify.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Task/Assets/ImageMinify.php b/src/Task/Assets/ImageMinify.php index 1aa625932..e90e20a0e 100644 --- a/src/Task/Assets/ImageMinify.php +++ b/src/Task/Assets/ImageMinify.php @@ -339,6 +339,8 @@ protected function minify($files) // loop through the files foreach ($files as $from => $to) { + $minifier = ''; + if (!isset($this->minifier)) { // check filetype based on the extension $extension = strtolower(pathinfo($from, PATHINFO_EXTENSION));