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

ImageMinify: Prevent undefined variable error #853

Conversation

pixelbrackets
Copy link
Contributor

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

Overview

This pull request:

  • Fixes a bug
  • Adds a feature
  • Breaks backwards compatibility
  • Has tests that cover changes

Summary

Adds an empty variable string to the beginning of the loop to check for matching minifiers. This will prevent trying to access a non existing variable later on.

Note

This bugfix is for the master (Development version 2.x).

It may also be cherry-picked to the 1.x branch as well (I could send a second PR as well).

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 consolidation#852
@greg-1-anderson
Copy link
Member

Thanks. A second PR would be helpful, as I wouldn't forget to cherry-pick this later if you did that.

@greg-1-anderson greg-1-anderson merged commit 3147669 into consolidation:master Apr 6, 2019
@pixelbrackets pixelbrackets changed the title ImageMinify: Prevent undefined variable error ImageMinify: Prevent undefined variable error (backport for 1.x) Apr 6, 2019
@pixelbrackets pixelbrackets changed the title ImageMinify: Prevent undefined variable error (backport for 1.x) ImageMinify: Prevent undefined variable error Apr 6, 2019
@pixelbrackets
Copy link
Contributor Author

Thanks for the fast merges! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants