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

do not crash on empty seconds in DSS module #434

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

jmper
Copy link
Contributor

@jmper jmper commented Feb 1, 2024

I have had several DSS/DS2 files that caused '[TypeError] mktime(): Argument #3 ($second) must be of type ?int, string given' in module.audio.dss.php in DSSdateStringToUnixDate() function.
After analyzing I found out that the files did not have seconds value in their creation date. So substr returned empty string and empty string passed to mktime() causes TypeError, at least in PHP 8.1 and later.
I have enclosed all substrings in DSSdateStringToUnixDate() with int() so they are always converted to integers, empty strings to zeros, and mktime() expects integers so it should be more or less correct.

@jmper jmper marked this pull request as ready for review February 1, 2024 12:37
@JamesHeinrich JamesHeinrich merged commit 23e4a2c into JamesHeinrich:master Feb 1, 2024
13 of 14 checks passed
@jmper jmper deleted the dsstimestamps branch February 1, 2024 15:45
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 this pull request may close these issues.

2 participants