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 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

This comment has been minimized.

Copy link
Member

f3l1x commented Apr 5, 2018

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

@vlastavesely

This comment has been minimized.

Copy link
Contributor Author

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
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.01%) to 91.969%
Details
dg added a commit that referenced this pull request Apr 5, 2018
Fixes problem with calling 'pathinfo()' with null filename.
@vlastavesely

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

dg commented Apr 6, 2018

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.