-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unix timestamp not detected and throw an error #9
Comments
flack
added a commit
that referenced
this issue
Sep 8, 2022
Fix #9 Unix timestamp string not detected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When passing a unix timestamp, the formatter tries to format it as a string and throw an error:
Uncaught Exception: Failed to parse time string (1671062400) at position 8 (0): Unexpected character in (...)vendor/openpsa/ranger/src/Ranger.php:243
The issue is that prepare_date() first checks if the input is a string (although, technically, an integer is also a string).
I solved it by replacing
with
I also replaced is_int() by is_numeric(), which is the recommended way to distinguish a number from a string, is_int() failing in some cases.
The text was updated successfully, but these errors were encountered: