Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.2

Bug #4179 Warning on unpack
Submitted: 2005-04-19 12:04 UTC
From: vincentlascaux Assigned: alexmerz
Status: Closed Package: MP3_ID
PHP Version: 5.0.3 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2005-04-19 12:04 UTC] vincentlascaux
Description: ------------ A warning is displayed on line 657 of Id.php. I know this is more a PHP bug, but this could be easily fixed (or at least I think so) by changing $bits = unpack('H*bits', $r); $bits = base_convert($bits['bits'],16,2); to $bits = sprintf("%'08b%'08b%'08b%'08b", ord($r{0}), ord($r{1}), ord($r{2}), ord($r{3})); Reproduce code: --------------- $mp3Reader = new MP3_Id(true); $mp3Reader->read("my_mp3_file.mp3"); $mp3Reader->study(); Expected result: ---------------- Should not display anything Actual result: -------------- Warning: unpack(): Type H: outside of string in C:\Program Files\php\PEAR\MP3\Id.php on line 657

Comments

 [2005-04-19 12:28 UTC] alexmerz at php dot net
I will figure this out. The problem with unpack&co and equivalent replacements is often critical due to mystical ;-) type conversations in PHP.
 [2005-07-04 11:35 UTC] alexmerz
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/MP3_ID
 [2005-08-24 12:38 UTC] hans_moors at hotmail dot com
I used the file Id.php from the latest version, but it still doesn't work for me, the same error Warning: unpack(): Type H: outside of string in C:\Program Files\php\PEAR\MP3\Id.php on line 657 over and over again.
 [2005-08-24 12:43 UTC] hans_moors at hotmail dot com
sorry, my mistake i replaced the file at a wrong place
 [2005-08-25 10:03 UTC] hans_moors at hotmail dot com
When i read the tags of a mp3-file i get several '\0'-characters in my results this is what i do require_once 'Id.php'; $mp3 = new MP3_Id(); $mp3->read("D:/My Documents/My Music/Millionaire/10 Wake Up the Children.mp3"); $mp3->study(); print_r($mp3); results in MP3_Id Object ( [file] => D:/My Documents/My Music/Millionaire/10- 10 Wake Up the Children.mp3 [id3v1] => 1 [id3v11] => [id3v2] => [name] => Wake Up the Children\0\0\0\0\0 [artists] => \0\0\0\0\0Millionaire\0\0\0\0\ [album] => 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0P [year] => arad [comment] => isiac\0\0\0\0\0\0\0\0\0\0\0\0\ [track] => 0 [genre] => Ethnic [genreno] => 48 [studied] => 1 [mpeg_ver] => 2 [layer] => 3 [bitrate] => 56 [crc] => [frequency] => 24000 [padding] => 0 [private] => 0 [mode] => Joint Stereo [copyright] => 0 [original] => 1 [emphasis] => none [filesize] => 422016 [frameoffset] => 1552 [length] => 01:00 [lengths] => 60 [error] => [debug] => [debugbeg] => [debugend] => [study] => ) it should be: name = Wake up the children artist = Millionaire album = Paradisiac
 [2005-08-25 11:45 UTC] alexmerz
I can't verify this behavoir. Please, could you send me the mp3 file to test it?
 [2005-08-25 14:05 UTC] alexmerz
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/MP3_ID The problem was caused by magic_quotes_runtime = On