wapmorgan / Mp3Info

The fastest PHP library to extract mp3 meta information (duration, bitrate, samplerate and so on) and tags (id3v1, id3v2).
https://wapmorgan.github.io/Mp3Info/
GNU Lesser General Public License v3.0
139 stars 41 forks source link

mb_convert_encoding(): Passing null to parameter #1 ($string) of type array|string is deprecated in Mp3Info.php on line 704 #29

Closed kesselb closed 1 year ago

kesselb commented 1 year ago

Hi,

I see the following a deprecation warning with our test file: https://github.com/nextcloud/server/blob/master/tests/data/testimage.mp3

PHP Deprecated: mb_convert_encoding(): Passing null to parameter #1 ($string) of type array|string is deprecated in Mp3Info.php on line 704

https://github.com/wapmorgan/Mp3Info/blob/a28101d523d271e52c43ff0854e55cc3f110d2de/src/Mp3Info.php#L690

Changing $short_description = null; to $short_description = ''; fixes the error for me. I know too little about ID3v2 to judge it that's correct.

wapmorgan commented 1 year ago

Try 0.1.0 version

kesselb commented 1 year ago

Thank you :+1:

No more deprecation warnings with our test file :tada:

painbaker commented 1 year ago

Still passing null for id3v2.4.0:

https://github.com/wapmorgan/Mp3Info/blob/d749cdd86201ecde740af9863ca1c940c456893e/src/Mp3Info.php#L890

And it is also possible for $actual_text:

https://github.com/wapmorgan/Mp3Info/blob/d749cdd86201ecde740af9863ca1c940c456893e/src/Mp3Info.php#L696-L702 https://github.com/wapmorgan/Mp3Info/blob/d749cdd86201ecde740af9863ca1c940c456893e/src/Mp3Info.php#L898-L902