Prevent TypeError when using built-in constants in setOption. Fixes #1538#1540
Merged
Conversation
2 tasks
setOptionsetOption. Fixes 31538
jrchamp
reviewed
Apr 4, 2019
In strict_type mode `Redis::setOption` requires the second argument to be of type `string`. This throws a TypeError for some options, even when using built-in constants The type of `value` argument of setOption has been changed to mixed to prevent the error.
JoyceBabu
commented
Apr 4, 2019
| if (val_str && val_len > 0) { | ||
| redis_sock->prefix = zend_string_init(val_str, val_len, 0); | ||
| val_str = zval_get_string(val); | ||
| if (ZSTR_LEN(val_str) > 0) { |
Contributor
There was a problem hiding this comment.
Sorry - I'm not as familiar with the zend code.
setOption. Fixes 31538setOption. Fixes #1538
Member
|
Merged, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In strict_type mode
Redis::setOptionrequires the second argumentto be of type
string. This throws a TypeError for some options,even when using built-in constants
The type of
valueargument of setOption has been changed tomixedto prevent the error.