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

setExpires/getMaxAge: Notice: A non well formed numeric value encountered #2888

Closed
not-implemented opened this issue May 11, 2021 · 0 comments · Fixed by #2914
Closed

setExpires/getMaxAge: Notice: A non well formed numeric value encountered #2888

not-implemented opened this issue May 11, 2021 · 0 comments · Fixed by #2914

Comments

@not-implemented
Copy link

not-implemented commented May 11, 2021

Guzzle version(s) affected: 7.3.0
PHP version: 7.3.19-1~deb10u1
cURL version: 7.66.0

Description
The line $this->setExpires(\time() + $this->getMaxAge()); generates a "Notice: A non well formed numeric value encountered" when the received Cookie contains an invalid "Max-Age" for the cookie.

How to reproduce
In my case the server returned two comma separated values for Max-Age: "63071999,9843797"

Possible Solution
Either explicitly cast the return value from $this->getMaxAge() to "int", or add an additional validation for "digits only".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant