IsValidID3v2FrameName example

                    $framedata    = substr($framedata, 10);    // and leave the rest in $framedata
                    $frame_name = substr($frame_header, 0, 4);
                    if ($id3v2_majorversion == 3) {
                        $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer                     } else { // ID3v2.4+                         $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 1); // 32-bit synchsafe integer (28-bit value)                     }

                    if ($frame_size < (strlen($framedata) + 4)) {
                        $nextFrameID = substr($framedata$frame_size, 4);
                        if ($this->IsValidID3v2FrameName($nextFrameID$id3v2_majorversion)) {
                            // next frame is OK                         } elseif (($frame_name == "\x00".'MP3') || ($frame_name == "\x00\x00".'MP') || ($frame_name == ' MP3') || ($frame_name == 'MP3e')) {
                            // MP3ext known broken frames - "ok" for the purposes of this test                         } elseif (($id3v2_majorversion == 4) && ($this->IsValidID3v2FrameName(substr($framedata, getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0), 4), 3))) {
                            $this->warning('ID3v2 tag written as ID3v2.4, but with non-synchsafe integers (ID3v2.3 style). Older versions of (Helium2; iTunes) are known culprits of this. Tag has been parsed as ID3v2.3');
                            $id3v2_majorversion = 3;
                            $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer                         }
                    }


                    
Home | Imprint | This part of the site doesn't use cookies.