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

Image: throw exception when $file and $type is null #170

Merged
merged 1 commit into from Apr 5, 2018

Conversation

vlastavesely
Copy link
Contributor

@vlastavesely vlastavesely commented Apr 5, 2018

Fixes problem with calling 'pathinfo()' with null filename.

  • bug fix? yes
  • BC break? no

Fixes problem with calling 'pathinfo()' with null filename.
@f3l1x
Copy link
Member

@f3l1x f3l1x commented Apr 5, 2018

Maybe file should be not null? I'm not sure, just wondering.. @dg ?

@vlastavesely
Copy link
Contributor Author

@vlastavesely vlastavesely commented Apr 5, 2018

Image::send() calls the save() function with $file being set to NULL and you can never be sure whether someone does not use the same way in their application. I think that it would be a BC. My solution just converts confusing typehint error to more understandable exception.

@dg dg merged commit 760445d into nette:master Apr 5, 2018
2 checks passed
dg pushed a commit that referenced this issue Apr 5, 2018
Fixes problem with calling 'pathinfo()' with null filename.
@vlastavesely
Copy link
Contributor Author

@vlastavesely vlastavesely commented Apr 6, 2018

@dg What does it solve? Image::save() still can be called with no arguments and thus emit TypeError (pathinfo() expects parameter 1 to be string, null given).

@dg
Copy link
Member

@dg dg commented Apr 6, 2018

Fixed

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

Successfully merging this pull request may close these issues.

None yet

3 participants