JamesHeinrich / getID3

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

PHP 8.1: getid3_quicktime::QuicktimeParseContainerAtom(): fix deprecation notice #337

Closed jrfnl closed 3 years ago

jrfnl commented 3 years ago

The $atom_structure is declared at the start of the method as false, but is subsequently assigned to as if it were an array in line 2122.

This will throw a deprecation notice as of PHP 8.1: Deprecated: Automatic conversion of false to array is deprecated in path/to/getid3/module.audio-video.quicktime.php on line 2122

Fixed now, by setting the initial value as an empty array, breaking out of the while instead of returning and checking whether the array is still empty at the end, and if so, returning false.

This should maintain the existing behaviour, but get round the deprecation notice.

Ref: https://wiki.php.net/rfc/autovivification_false