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

Fixed dump issue with non-string values #204

Merged
merged 1 commit into from Sep 14, 2018
Merged

Fixed dump issue with non-string values #204

merged 1 commit into from Sep 14, 2018

Conversation

@bckp
Copy link
Contributor

bckp commented Sep 11, 2018

If you call ResultSet::dump with null as column value, it will raise TypeError, so $col should be retyped to string, as htmlspecialchars expects string.

  • bug fix
  • BC break? no
@bckp

This comment has been minimized.

Copy link
Contributor Author

bckp commented Sep 11, 2018

Or maybe add new Helper, that will translate column value to the proper type (boolean, string, number, null)

@dg dg force-pushed the nette:master branch from a888277 to 65a8029 Sep 13, 2018
If you call dump on ResultSet and non-string value (like null) exists, dump will raise TypeError exception on PHP7.1 and newer (maybe even on older version).
This add new static dumpVar method, that will try to escape value and return always string.
@bckp bckp force-pushed the bckp:patch-1 branch from 596090f to bbca795 Sep 14, 2018
@bckp

This comment has been minimized.

Copy link
Contributor Author

bckp commented Sep 14, 2018

@dg ping, if you have any ideas, what should be changed, just give me call :)

@dg

This comment has been minimized.

Copy link
Member

dg commented Sep 14, 2018

I'll make it little bit simpler, ok? ;-)

@dg dg merged commit 1d1d2a6 into nette:master Sep 14, 2018
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
dg added a commit that referenced this pull request Sep 14, 2018
If you call dump on ResultSet and non-string value (like null) exists, dump will raise TypeError exception on PHP7.1 and newer (maybe even on older version).
This add new static dumpVar method, that will try to escape value and return always string.
dg added a commit that referenced this pull request Sep 14, 2018
If you call dump on ResultSet and non-string value (like null) exists, dump will raise TypeError exception on PHP7.1 and newer (maybe even on older version).
This add new static dumpVar method, that will try to escape value and return always string.
@bckp

This comment has been minimized.

Copy link
Contributor Author

bckp commented Sep 14, 2018

Sure :-)

@bckp bckp deleted the bckp:patch-1 branch Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.