Parsed: 112624

  public static function ID3v22iTunesBrokenFrameName($frame_name) {
    // iTunes (multiple versions) has been known to write ID3v2.3 style frames
    // but use ID3v2.2 frame names, right-padded using either [space] or [null]
    // to make them fit in the 4-byte frame name space of the ID3v2.3 frame.
    // This function will detect and translate the corrupt frame name into ID3v2.3 standard.
    static $ID3v22_iTunes_BrokenFrames = array(
      'BUF' => 'RBUF', // Recommended buffer size
      'CNT' => 'PCNT', // Play counter
      'COM' => 'COMM', // Comments
      'CRA' => 'AENC', // Audio encryption
      'EQU' => 'EQUA', // Equalisation
      'ETC' => 'ETCO', // Event timing codes
      'GEO' => 'GEOB', // General encapsulated object
      'IPL' => 'IPLS', // Involved people list
      'LNK' => 'LINK', // Linked information
      'MCI' => 'MCDI', // Music CD identifier
      'MLL' => 'MLLT', // MPEG location lookup table
      'PIC' => 'APIC', // Attached picture
      'POP' => 'POPM', // Popularimeter
      'REV' => 'RVRB', // Reverb
      'RVA' => 'RVAD', // Relative volume adjustment
      'SLT' => 'SYLT', // Synchronised lyric/text
      'STC' => 'SYTC', // Synchronised tempo codes
      'TAL' => 'TALB', // Album/Movie/Show title
      'TBP' => 'TBPM', // BPM (beats per minute)
      'TCM' => 'TCOM', // Composer
      'TCO' => 'TCON', // Content type
      'TCP' => 'TCMP', // Part of a compilation
      'TCR' => 'TCOP', // Copyright message
      'TDA' => 'TDAT', // Date
      'TDY' => 'TDLY', // Playlist delay
      'TEN' => 'TENC', // Encoded by
      'TFT' => 'TFLT', // File type
      'TIM' => 'TIME', // Time
      'TKE' => 'TKEY', // Initial key
      'TLA' => 'TLAN', // Language(s)
      'TLE' => 'TLEN', // Length
      'TMT' => 'TMED', // Media type
      'TOA' => 'TOPE', // Original artist(s)/performer(s)
      'TOF' => 'TOFN', // Original filename
      'TOL' => 'TOLY', // Original lyricist(s)/text writer(s)
      'TOR' => 'TORY', // Original release year
      'TOT' => 'TOAL', // Original album/movie/show title
      'TP1' => 'TPE1', // Lead performer(s)/Soloist(s)
      'TP2' => 'TPE2', // Band/orchestra/accompaniment
      'TP3' => 'TPE3', // Conductor/performer refinement
      'TP4' => 'TPE4', // Interpreted, remixed, or otherwise modified by
      'TPA' => 'TPOS', // Part of a set
      'TPB' => 'TPUB', // Publisher
      'TRC' => 'TSRC', // ISRC (international standard recording code)
      'TRD' => 'TRDA', // Recording dates
      'TRK' => 'TRCK', // Track number/Position in set
      'TS2' => 'TSO2', // Album-Artist sort order
      'TSA' => 'TSOA', // Album sort order
      'TSC' => 'TSOC', // Composer sort order
      'TSI' => 'TSIZ', // Size
      'TSP' => 'TSOP', // Performer sort order
      'TSS' => 'TSSE', // Software/Hardware and settings used for encoding
      'TST' => 'TSOT', // Title sort order
      'TT1' => 'TIT1', // Content group description
      'TT2' => 'TIT2', // Title/songname/content description
      'TT3' => 'TIT3', // Subtitle/Description refinement
      'TXT' => 'TEXT', // Lyricist/Text writer
      'TXX' => 'TXXX', // User defined text information frame
      'TYE' => 'TYER', // Year
      'UFI' => 'UFID', // Unique file identifier
      'ULT' => 'USLT', // Unsynchronised lyric/text transcription
      'WAF' => 'WOAF', // Official audio file webpage
      'WAR' => 'WOAR', // Official artist/performer webpage
      'WAS' => 'WOAS', // Official audio source webpage
      'WCM' => 'WCOM', // Commercial information
      'WCP' => 'WCOP', // Copyright/Legal information
      'WPB' => 'WPUB', // Publishers official webpage
      'WXX' => 'WXXX', // User defined URL link frame
    );
    if (strlen($frame_name) == 4) {
      if ((substr($frame_name, 3, 1) == ' ') || (substr($frame_name, 3, 1) == "\x00")) {
        if (isset($ID3v22_iTunes_BrokenFrames[substr($frame_name, 0, 3)])) {
          return $ID3v22_iTunes_BrokenFrames[substr($frame_name, 0, 3)];
        }
      }
    }
    return false;
  }