$frame_terminatorpos =
strpos($parsedFrame['data'
],
$frame_textencoding_terminator,
$frame_offset);
if (ord(substr($parsedFrame['data'
],
$frame_terminatorpos +
strlen($frame_textencoding_terminator), 1
)) === 0
) { $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
} $parsedFrame['description'
] =
substr($parsedFrame['data'
],
$frame_offset,
$frame_terminatorpos -
$frame_offset);
$parsedFrame['description'
] =
$this->
MakeUTF16emptyStringEmpty($parsedFrame['description'
]);
$parsedFrame['encodingid'
] =
$frame_textencoding;
$parsedFrame['encoding'
] =
$this->
TextEncodingNameLookup($frame_textencoding);
$parsedFrame['description'
] =
trim(getid3_lib::
iconv_fallback($parsedFrame['encoding'
],
$info['id3v2'
]['encoding'
],
$parsedFrame['description'
]));
$parsedFrame['data'
] =
substr($parsedFrame['data'
],
$frame_terminatorpos +
strlen($frame_textencoding_terminator));
$parsedFrame['data'
] =
$this->
RemoveStringTerminator($parsedFrame['data'
],
$frame_textencoding_terminator);
if (!
empty($parsedFrame['framenameshort'
]) && !
empty($parsedFrame['data'
])) { $commentkey =
($parsedFrame['description'
] ?
$parsedFrame['description'
] :
(isset($info['id3v2'
]['comments'
][$parsedFrame['framenameshort'
]]) ?
count($info['id3v2'
]['comments'
][$parsedFrame['framenameshort'
]]) : 0
));
if (!
isset($info['id3v2'
]['comments'
][$parsedFrame['framenameshort'
]]) || !
array_key_exists($commentkey,
$info['id3v2'
]['comments'
][$parsedFrame['framenameshort'
]])) { $info['id3v2'
]['comments'
][$parsedFrame['framenameshort'
]][$commentkey] =
trim(getid3_lib::
iconv_fallback($parsedFrame['encoding'
],
$info['id3v2'
]['encoding'
],
$parsedFrame['data'
]));
} else { $info['id3v2'
]['comments'
][$parsedFrame['framenameshort'
]][] =
trim(getid3_lib::
iconv_fallback($parsedFrame['encoding'
],
$info['id3v2'
]['encoding'
],
$parsedFrame['data'
]));
} } //unset($parsedFrame['data']); do not unset, may be needed elsewhere, e.g. for replaygain
}