-
-
Notifications
You must be signed in to change notification settings - Fork 603
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
Prevent type conversions issues when parsing time-fractions #710
Conversation
We received reports of users experiencing exceptions when parsing JWTs with timestamps with precision beyond microseconds on time-fractions. This guards against having any kind of edge-case when dealing with floats as input to the creation of DateTimeImmutable objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Token/Parser.php:118
* @param int|float|string $timestamp
Are you sur that its okey to put even string into param type ?
@param => accepted type in 'documentation'
Not accepting it is a BC-break with previously created tokens in v4. So, we have to support until v5 - that's also why I added a test to cover that. We can mark that as deprecated but it's not really a hill I'd die on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some bad news : https://3v4l.org/pTqmM 🤔 wait a minute nvm, i forgot the was u.u 😅 and number_format add .u format to integer
I dont have anything to add 💪 gj |
We received reports of users experiencing exceptions when parsing JWTs with timestamps with precision beyond microseconds on time-fractions.
This guards against having any kind of edge-case when dealing with floats as input to the creation of DateTimeImmutable objects.