Sonerezh / sonerezh

A self-hosted, web-based application to stream your music, everywhere.
https://www.sonerezh.bzh
GNU Affero General Public License v3.0
767 stars 122 forks source link

Bug if tag contains only "0" #368

Open MightyCreak opened 5 years ago

MightyCreak commented 5 years ago

I happened to encounter a bug recently with Low Roar's album: "0".

Since empty("0") is true, there is a problem with this code in SongManager.php:

        // Song album
        if (!empty($file_infos['comments']['album'])) {
            $metadata['album'] = end($file_infos['comments']['album']);
        } else {
            $metadata['album'] = 'Unknown album';
        }

Do you think isset would be a better approach than empty?

MightyCreak commented 5 years ago

Digging a little deeper, it seems that the issue is not from there, but could be coming from getID3 which probably has the same issue somewhere in their code...