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 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
Copy link
Contributor Author

@bckp bckp commented Sep 11, 2018

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

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
Copy link
Contributor Author

@bckp bckp commented Sep 14, 2018

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

@dg
Copy link
Member

@dg 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
dg pushed a commit that referenced this issue 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 pushed a commit that referenced this issue 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
Copy link
Contributor Author

@bckp bckp commented Sep 14, 2018

Sure :-)

@bckp bckp deleted the patch-1 branch Sep 14, 2018
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

2 participants