mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
php8: more id3 parser fixes
This commit is contained in:
@@ -39,7 +39,7 @@ class getid3_id3v1 extends getid3_handler
|
||||
|
||||
// If second-last byte of comment field is null and last byte of comment field is non-null
|
||||
// then this is ID3v1.1 and the comment field is 28 bytes long and the 30th byte is the track number
|
||||
if (($id3v1tag{125} === "\x00") && ($id3v1tag{126} !== "\x00")) {
|
||||
if (($id3v1tag[125] === "\x00") && ($id3v1tag[126] !== "\x00")) {
|
||||
$ParsedID3v1['track'] = ord(substr($ParsedID3v1['comment'], 29, 1));
|
||||
$ParsedID3v1['comment'] = substr($ParsedID3v1['comment'], 0, 28);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ class getid3_id3v2 extends getid3_handler
|
||||
$thisfile_id3v2['padding']['length'] = strlen($framedata);
|
||||
$thisfile_id3v2['padding']['valid'] = true;
|
||||
for ($i = 0; $i < $thisfile_id3v2['padding']['length']; $i++) {
|
||||
if ($framedata{$i} != "\x00") {
|
||||
if ($framedata[$i] != "\x00") {
|
||||
$thisfile_id3v2['padding']['valid'] = false;
|
||||
$thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i;
|
||||
$info['warning'][] = 'Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)';
|
||||
@@ -314,7 +314,7 @@ class getid3_id3v2 extends getid3_handler
|
||||
|
||||
$len = strlen($framedata);
|
||||
for ($i = 0; $i < $len; $i++) {
|
||||
if ($framedata{$i} != "\x00") {
|
||||
if ($framedata[$i]!= "\x00") {
|
||||
$thisfile_id3v2['padding']['valid'] = false;
|
||||
$thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i;
|
||||
$info['warning'][] = 'Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)';
|
||||
@@ -648,7 +648,7 @@ class getid3_id3v2 extends getid3_handler
|
||||
//unset($parsedFrame['data']); do not unset, may be needed elsewhere, e.g. for replaygain
|
||||
|
||||
|
||||
} elseif ($parsedFrame['frame_name']{0} == 'T') { // 4.2. T??[?] Text information frame
|
||||
} elseif ($parsedFrame['frame_name'][0] == 'T') { // 4.2. T??[?] Text information frame
|
||||
// There may only be one text information frame of its kind in an tag.
|
||||
// <Header for 'Text information frame', ID: 'T000' - 'TZZZ',
|
||||
// excluding 'TXXX' described in 4.2.6.>
|
||||
@@ -750,7 +750,7 @@ class getid3_id3v2 extends getid3_handler
|
||||
unset($parsedFrame['data']);
|
||||
|
||||
|
||||
} elseif ($parsedFrame['frame_name']{0} == 'W') { // 4.3. W??? URL link frames
|
||||
} elseif ($parsedFrame['frame_name'][0] == 'W') { // 4.3. W??? URL link frames
|
||||
// There may only be one URL link frame of its kind in a tag,
|
||||
// except when stated otherwise in the frame description
|
||||
// <Header for 'URL link frame', ID: 'W000' - 'WZZZ', excluding 'WXXX'
|
||||
|
||||
Reference in New Issue
Block a user