Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Fixed #236 - problem with automatic casting of numeric values - #237

Closed
kalehmann wants to merge 1 commit into
Behatch:masterfrom
kalehmann:master
Closed

Fixed #236 - problem with automatic casting of numeric values#237
kalehmann wants to merge 1 commit into
Behatch:masterfrom
kalehmann:master

Conversation

@kalehmann

Copy link
Copy Markdown
Contributor

The automatic casting of numeric values in the BaseContext class
is limited by the PHP_INT_MAX constant. Any string with an numeric
value larger than PHP_INT_MAX gets automatically casted to an
integer with the value of PHP_INT_MAX.

This could lead to problems, for example when sending a http-header
with a large numeric value.

This workaround checks if the numeric value is equal or larger than
PHP_INT_MAX and does not cast to integer in this case.

@sanpii

sanpii commented Jan 24, 2018

Copy link
Copy Markdown
Member

Can you add a non-regression test like in #236 ?

kalehmann pushed a commit to kalehmann/contexts that referenced this pull request Jan 25, 2018
As suggested in Behatch#237 a new test for headers with numeric values larger than
PHP_INT_MAX has been added.
@kalehmann

Copy link
Copy Markdown
Contributor Author

Yes, I have done that.

@OskarStark

Copy link
Copy Markdown
Contributor

@kalehmann can you associate your commits emailadress with your github emailadress?

@kalehmann

Copy link
Copy Markdown
Contributor Author

Can I do this afterwards? I think I have to tell git my e-mail and then commit everything again to do so.

kalehmann pushed a commit to kalehmann/contexts that referenced this pull request Jan 25, 2018
As suggested in Behatch#237 a new test for headers with numeric values larger than
PHP_INT_MAX has been added.
@OskarStark

Copy link
Copy Markdown
Contributor

Its fine like this, @sanpii can squash your commits on merge

@sanpii sanpii added this to the 3.1 milestone Jan 25, 2018
@sanpii

sanpii commented Jan 25, 2018

Copy link
Copy Markdown
Member

@kalehmann you can squash all commits in one:

git reset --soft 32dcd9b
git commit
git push --force

This create a new commit and your new email will be used.

The automatic casting of numeric values in the BaseContext class
is limited by the PHP_INT_MAX constant. Any string with an numeric
value larger than PHP_INT_MAX gets automatically casted to an
integer with the value of PHP_INT_MAX.

This could lead to problems, for example when sending a http-header
with a large numeric value.

This workaround checks if the numeric value is equal or larger than
PHP_INT_MAX and does not cast to integer in this case.

Also added a test for this case.
@sanpii

sanpii commented Jan 25, 2018

Copy link
Copy Markdown
Member

Thank you 😃

@sanpii sanpii closed this Jan 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants