JamesHeinrich / getID3

http://www.getid3.org/
Other
1.13k stars 245 forks source link

do not crash on empty seconds in DSS module #433

Closed jmper closed 5 months ago

jmper commented 5 months ago

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 intval() so they are always converted to integers, empty strings to zeros, and mktime() expects integers so it should be more or less correct.