From c23a3b28c9b24ad4817b98fdc6985a2afaa02bca Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 7 Jan 2020 10:19:53 +0100 Subject: [PATCH] Bump christophwurst/id3parser to v0.1.1 Signed-off-by: Christoph Wurst --- .../src/getID3/Tags/getid3_id3v1.php | 2 +- .../src/getID3/Tags/getid3_id3v2.php | 40 +++--- .../id3parser/src/getID3/getid3_lib.php | 133 +++++++++--------- composer.json | 2 +- composer.lock | 12 +- composer/installed.json | 12 +- 6 files changed, 94 insertions(+), 107 deletions(-) diff --git a/christophwurst/id3parser/src/getID3/Tags/getid3_id3v1.php b/christophwurst/id3parser/src/getID3/Tags/getid3_id3v1.php index 18e850af1..944885b4f 100644 --- a/christophwurst/id3parser/src/getID3/Tags/getid3_id3v1.php +++ b/christophwurst/id3parser/src/getID3/Tags/getid3_id3v1.php @@ -39,7 +39,7 @@ public function Analyze() { // 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); } diff --git a/christophwurst/id3parser/src/getID3/Tags/getid3_id3v2.php b/christophwurst/id3parser/src/getID3/Tags/getid3_id3v2.php index 31742b7f2..f42eb7a2b 100644 --- a/christophwurst/id3parser/src/getID3/Tags/getid3_id3v2.php +++ b/christophwurst/id3parser/src/getID3/Tags/getid3_id3v2.php @@ -51,8 +51,8 @@ public function Analyze() { $header = $this->fread(10); if (substr($header, 0, 3) == 'ID3' && strlen($header) == 10) { - $thisfile_id3v2['majorversion'] = ord($header{3}); - $thisfile_id3v2['minorversion'] = ord($header{4}); + $thisfile_id3v2['majorversion'] = ord($header[3]); + $thisfile_id3v2['minorversion'] = ord($header[4]); // shortcut $id3v2_majorversion = &$thisfile_id3v2['majorversion']; @@ -71,7 +71,7 @@ public function Analyze() { } - $id3_flags = ord($header{5}); + $id3_flags = ord($header[5]); switch ($id3v2_majorversion) { case 2: // %ab000000 in v2.2 @@ -204,7 +204,6 @@ public function Analyze() { $thisfile_id3v2['exthead']['flags']['restrictions'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x10); if ($thisfile_id3v2['exthead']['flags']['update']) { - $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 0 $extended_header_offset += 1; } @@ -216,7 +215,6 @@ public function Analyze() { } if ($thisfile_id3v2['exthead']['flags']['restrictions']) { - $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 1 $extended_header_offset += 1; // %ppqrrstt @@ -252,7 +250,7 @@ public function Analyze() { $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 +312,7 @@ public function Analyze() { $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)'; @@ -422,11 +420,11 @@ public function Analyze() { $footer = $this->fread(10); if (substr($footer, 0, 3) == '3DI') { $thisfile_id3v2['footer'] = true; - $thisfile_id3v2['majorversion_footer'] = ord($footer{3}); - $thisfile_id3v2['minorversion_footer'] = ord($footer{4}); + $thisfile_id3v2['majorversion_footer'] = ord($footer[3]); + $thisfile_id3v2['minorversion_footer'] = ord($footer[4]); } if ($thisfile_id3v2['majorversion_footer'] <= 4) { - $id3_flags = ord(substr($footer{5})); + $id3_flags = ord(substr($footer[5])); $thisfile_id3v2_flags['unsynch_footer'] = (bool) ($id3_flags & 0x80); $thisfile_id3v2_flags['extfoot_footer'] = (bool) ($id3_flags & 0x40); $thisfile_id3v2_flags['experim_footer'] = (bool) ($id3_flags & 0x20); @@ -648,7 +646,7 @@ public function ParseID3v2Frame(&$parsedFrame) { //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. //
@@ -750,7 +748,7 @@ public function ParseID3v2Frame(&$parsedFrame) { 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 //
$value) { if (($key % 2) == 0) { $position = $value; @@ -825,7 +822,6 @@ public function ParseID3v2Frame(&$parsedFrame) { $person = $value; $IPLS_parts[] = array('position'=>$position, 'person'=>$person); $position = ''; - $person = ''; } } } else { @@ -901,6 +897,7 @@ public function ParseID3v2Frame(&$parsedFrame) { $parsedFrame['bitsforbytesdeviation'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 8, 1)); $parsedFrame['bitsformsdeviation'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 9, 1)); $parsedFrame['data'] = substr($parsedFrame['data'], 10); + $deviationbitstream = ''; while ($frame_offset < strlen($parsedFrame['data'])) { $deviationbitstream .= getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1)); } @@ -969,7 +966,6 @@ public function ParseID3v2Frame(&$parsedFrame) { $parsedFrame['encodingid'] = $frame_textencoding; $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - $parsedFrame['data'] = $parsedFrame['data']; $parsedFrame['language'] = $frame_language; $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false); $parsedFrame['description'] = $frame_description; @@ -1025,7 +1021,7 @@ public function ParseID3v2Frame(&$parsedFrame) { $parsedFrame['lyrics'][$timestampindex]['data'] = substr($frame_remainingdata, $frame_offset, $frame_terminatorpos - $frame_offset); $frame_remainingdata = substr($frame_remainingdata, $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding))); - if (($timestampindex == 0) && (ord($frame_remainingdata{0}) != 0)) { + if (($timestampindex == 0) && (ord($frame_remainingdata[0]) != 0)) { // timestamp probably omitted for first data item } else { $parsedFrame['lyrics'][$timestampindex]['timestamp'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 0, 4)); @@ -1212,7 +1208,6 @@ public function ParseID3v2Frame(&$parsedFrame) { } $frame_offset += $frame_bytesvolume; $parsedFrame['peakvolume']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - $frame_offset += $frame_bytesvolume; } } unset($parsedFrame['data']); @@ -1306,7 +1301,7 @@ public function ParseID3v2Frame(&$parsedFrame) { $parsedFrame['feedbackRR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); $parsedFrame['feedbackRL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); $parsedFrame['premixLR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['premixRL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['premixRL'] = ord(substr($parsedFrame['data'], $frame_offset, 1)); unset($parsedFrame['data']); @@ -1552,7 +1547,7 @@ public function ParseID3v2Frame(&$parsedFrame) { $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); if (ord($frame_ownerid) === 0) { - $frame_ownerid == ''; + $frame_ownerid = ''; } $frame_offset = $frame_terminatorpos + strlen("\x00"); $parsedFrame['ownerid'] = $frame_ownerid; @@ -1878,7 +1873,6 @@ public function ParseID3v2Frame(&$parsedFrame) { $rg_track_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2)); $frame_offset += 2; $rg_album_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2)); - $frame_offset += 2; $parsedFrame['raw']['track']['name'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 0, 3)); $parsedFrame['raw']['track']['originator'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 3, 3)); $parsedFrame['raw']['track']['signbit'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 6, 1)); @@ -3334,10 +3328,10 @@ public static function IsValidID3v2FrameName($framename, $id3v2majorversion) { public static function IsANumber($numberstring, $allowdecimal=false, $allownegative=false) { for ($i = 0; $i < strlen($numberstring); $i++) { - if ((chr($numberstring{$i}) < chr('0')) || (chr($numberstring{$i}) > chr('9'))) { - if (($numberstring{$i} == '.') && $allowdecimal) { + if ((chr($numberstring[$i]) < chr('0')) || (chr($numberstring[$i]) > chr('9'))) { + if (($numberstring[$i] == '.') && $allowdecimal) { // allowed - } elseif (($numberstring{$i} == '-') && $allownegative && ($i == 0)) { + } elseif (($numberstring[$i] == '-') && $allownegative && ($i == 0)) { // allowed } else { return false; diff --git a/christophwurst/id3parser/src/getID3/getid3_lib.php b/christophwurst/id3parser/src/getID3/getid3_lib.php index cd5b3e03c..dbcc10dbc 100644 --- a/christophwurst/id3parser/src/getID3/getid3_lib.php +++ b/christophwurst/id3parser/src/getID3/getid3_lib.php @@ -85,11 +85,11 @@ public static function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) { // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html if (strpos($binarypointnumber, '.') === false) { $binarypointnumber = '0.'.$binarypointnumber; - } elseif ($binarypointnumber{0} == '.') { + } elseif ($binarypointnumber[0] == '.') { $binarypointnumber = '0'.$binarypointnumber; } $exponent = 0; - while (($binarypointnumber{0} != '1') || (substr($binarypointnumber, 1, 1) != '.')) { + while (($binarypointnumber[0] != '1') || (substr($binarypointnumber, 1, 1) != '.')) { if (substr($binarypointnumber, 1, 1) == '.') { $exponent--; $binarypointnumber = substr($binarypointnumber, 2, 1).'.'.substr($binarypointnumber, 3); @@ -97,7 +97,7 @@ public static function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) { $pointpos = strpos($binarypointnumber, '.'); $exponent += ($pointpos - 1); $binarypointnumber = str_replace('.', '', $binarypointnumber); - $binarypointnumber = $binarypointnumber{0}.'.'.substr($binarypointnumber, 1); + $binarypointnumber = $binarypointnumber[0].'.'.substr($binarypointnumber, 1); } } $binarypointnumber = str_pad(substr($binarypointnumber, 0, $maxbits + 2), $maxbits + 2, '0', STR_PAD_RIGHT); @@ -116,8 +116,7 @@ public static function Float2BinaryDecimal($floatvalue) { $pointbitstring .= (string) self::trunc($floatpart); $floatpart -= self::trunc($floatpart); } - $binarypointnumber = decbin($intpart).'.'.$pointbitstring; - return $binarypointnumber; + return decbin($intpart).'.'.$pointbitstring; } @@ -166,7 +165,7 @@ public static function BigEndian2Float($byteword) { if (!$bitword) { return 0; } - $signbit = $bitword{0}; + $signbit = $bitword[0]; switch (strlen($byteword) * 8) { case 32: @@ -183,7 +182,7 @@ public static function BigEndian2Float($byteword) { // 80-bit Apple SANE format // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ $exponentstring = substr($bitword, 1, 15); - $isnormalized = intval($bitword{16}); + $isnormalized = intval($bitword[16]); $fractionstring = substr($bitword, 17, 63); $exponent = pow(2, self::Bin2Dec($exponentstring) - 16383); $fraction = $isnormalized + self::DecimalBinary2Float($fractionstring); @@ -213,11 +212,6 @@ public static function BigEndian2Float($byteword) { $floatvalue = '+infinity'; } } elseif (($exponent == 0) && ($fraction == 0)) { - if ($signbit == '1') { - $floatvalue = -0; - } else { - $floatvalue = 0; - } $floatvalue = ($signbit ? 0 : -0); } elseif (($exponent == 0) && ($fraction != 0)) { // These are 'unnormalized' values @@ -243,10 +237,10 @@ public static function BigEndian2Int($byteword, $synchsafe=false, $signed=false) } for ($i = 0; $i < $bytewordlen; $i++) { if ($synchsafe) { // disregard MSB, effectively 7-bit bytes - //$intvalue = $intvalue | (ord($byteword{$i}) & 0x7F) << (($bytewordlen - 1 - $i) * 7); // faster, but runs into problems past 2^31 on 32-bit systems - $intvalue += (ord($byteword{$i}) & 0x7F) * pow(2, ($bytewordlen - 1 - $i) * 7); + //$intvalue = $intvalue | (ord($byteword[$i]) & 0x7F) << (($bytewordlen - 1 - $i) * 7); // faster, but runs into problems past 2^31 on 32-bit systems + $intvalue += (ord($byteword[$i]) & 0x7F) * pow(2, ($bytewordlen - 1 - $i) * 7); } else { - $intvalue += ord($byteword{$i}) * pow(256, ($bytewordlen - 1 - $i)); + $intvalue += ord($byteword[$i]) * pow(256, ($bytewordlen - 1 - $i)); } } if ($signed && !$synchsafe) { @@ -273,7 +267,7 @@ public static function BigEndian2Bin($byteword) { $binvalue = ''; $bytewordlen = strlen($byteword); for ($i = 0; $i < $bytewordlen; $i++) { - $binvalue .= str_pad(decbin(ord($byteword{$i})), 8, '0', STR_PAD_LEFT); + $binvalue .= str_pad(decbin(ord($byteword[$i])), 8, '0', STR_PAD_LEFT); } return $binvalue; } @@ -317,7 +311,7 @@ public static function Dec2Bin($number) { public static function Bin2Dec($binstring, $signed=false) { $signmult = 1; if ($signed) { - if ($binstring{0} == '1') { + if ($binstring[0] == '1') { $signmult = -1; } $binstring = substr($binstring, 1); @@ -538,7 +532,7 @@ public static function iconv_fallback_iso88591_utf8($string, $bom=false) { $newcharstring .= "\xEF\xBB\xBF"; } for ($i = 0; $i < strlen($string); $i++) { - $charval = ord($string{$i}); + $charval = ord($string[$i]); $newcharstring .= self::iconv_fallback_int_utf8($charval); } return $newcharstring; @@ -551,7 +545,7 @@ public static function iconv_fallback_iso88591_utf16be($string, $bom=false) { $newcharstring .= "\xFE\xFF"; } for ($i = 0; $i < strlen($string); $i++) { - $newcharstring .= "\x00".$string{$i}; + $newcharstring .= "\x00".$string[$i]; } return $newcharstring; } @@ -563,7 +557,7 @@ public static function iconv_fallback_iso88591_utf16le($string, $bom=false) { $newcharstring .= "\xFF\xFE"; } for ($i = 0; $i < strlen($string); $i++) { - $newcharstring .= $string{$i}."\x00"; + $newcharstring .= $string[$i]."\x00"; } return $newcharstring; } @@ -583,27 +577,27 @@ public static function iconv_fallback_utf8_iso88591($string) { $offset = 0; $stringlength = strlen($string); while ($offset < $stringlength) { - if ((ord($string{$offset}) | 0x07) == 0xF7) { + if ((ord($string[$offset]) | 0x07) == 0xF7) { // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) & - ((ord($string{($offset + 1)}) & 0x3F) << 12) & - ((ord($string{($offset + 2)}) & 0x3F) << 6) & - (ord($string{($offset + 3)}) & 0x3F); + $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) & + ((ord($string[($offset + 1)]) & 0x3F) << 12) & + ((ord($string[($offset + 2)]) & 0x3F) << 6) & + (ord($string[($offset + 3)]) & 0x3F); $offset += 4; - } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) { + } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) { // 1110bbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) & - ((ord($string{($offset + 1)}) & 0x3F) << 6) & - (ord($string{($offset + 2)}) & 0x3F); + $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) & + ((ord($string[($offset + 1)]) & 0x3F) << 6) & + (ord($string[($offset + 2)]) & 0x3F); $offset += 3; - } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) { + } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) { // 110bbbbb 10bbbbbb - $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) & - (ord($string{($offset + 1)}) & 0x3F); + $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) & + (ord($string[($offset + 1)]) & 0x3F); $offset += 2; - } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) { + } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) { // 0bbbbbbb - $charval = ord($string{$offset}); + $charval = ord($string[$offset]); $offset += 1; } else { // error? throw some kind of warning here? @@ -626,27 +620,27 @@ public static function iconv_fallback_utf8_utf16be($string, $bom=false) { $offset = 0; $stringlength = strlen($string); while ($offset < $stringlength) { - if ((ord($string{$offset}) | 0x07) == 0xF7) { + if ((ord($string[$offset]) | 0x07) == 0xF7) { // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) & - ((ord($string{($offset + 1)}) & 0x3F) << 12) & - ((ord($string{($offset + 2)}) & 0x3F) << 6) & - (ord($string{($offset + 3)}) & 0x3F); + $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) & + ((ord($string[($offset + 1)]) & 0x3F) << 12) & + ((ord($string[($offset + 2)]) & 0x3F) << 6) & + (ord($string[($offset + 3)]) & 0x3F); $offset += 4; - } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) { + } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) { // 1110bbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) & - ((ord($string{($offset + 1)}) & 0x3F) << 6) & - (ord($string{($offset + 2)}) & 0x3F); + $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) & + ((ord($string[($offset + 1)]) & 0x3F) << 6) & + (ord($string[($offset + 2)]) & 0x3F); $offset += 3; - } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) { + } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) { // 110bbbbb 10bbbbbb - $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) & - (ord($string{($offset + 1)}) & 0x3F); + $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) & + (ord($string[($offset + 1)]) & 0x3F); $offset += 2; - } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) { + } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) { // 0bbbbbbb - $charval = ord($string{$offset}); + $charval = ord($string[$offset]); $offset += 1; } else { // error? throw some kind of warning here? @@ -669,27 +663,27 @@ public static function iconv_fallback_utf8_utf16le($string, $bom=false) { $offset = 0; $stringlength = strlen($string); while ($offset < $stringlength) { - if ((ord($string{$offset}) | 0x07) == 0xF7) { + if ((ord($string[$offset]) | 0x07) == 0xF7) { // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) & - ((ord($string{($offset + 1)}) & 0x3F) << 12) & - ((ord($string{($offset + 2)}) & 0x3F) << 6) & - (ord($string{($offset + 3)}) & 0x3F); + $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) & + ((ord($string[($offset + 1)]) & 0x3F) << 12) & + ((ord($string[($offset + 2)]) & 0x3F) << 6) & + (ord($string[($offset + 3)]) & 0x3F); $offset += 4; - } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) { + } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) { // 1110bbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) & - ((ord($string{($offset + 1)}) & 0x3F) << 6) & - (ord($string{($offset + 2)}) & 0x3F); + $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) & + ((ord($string[($offset + 1)]) & 0x3F) << 6) & + (ord($string[($offset + 2)]) & 0x3F); $offset += 3; - } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) { + } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) { // 110bbbbb 10bbbbbb - $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) & - (ord($string{($offset + 1)}) & 0x3F); + $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) & + (ord($string[($offset + 1)]) & 0x3F); $offset += 2; - } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) { + } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) { // 0bbbbbbb - $charval = ord($string{$offset}); + $charval = ord($string[$offset]); $offset += 1; } else { // error? maybe throw some warning here? @@ -886,22 +880,22 @@ public static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') case 'UTF-8': $strlen = strlen($string); for ($i = 0; $i < $strlen; $i++) { - $char_ord_val = ord($string{$i}); + $char_ord_val = ord($string[$i]); $charval = 0; if ($char_ord_val < 0x80) { $charval = $char_ord_val; } elseif ((($char_ord_val & 0xF0) >> 4) == 0x0F && $i+3 < $strlen) { $charval = (($char_ord_val & 0x07) << 18); - $charval += ((ord($string{++$i}) & 0x3F) << 12); - $charval += ((ord($string{++$i}) & 0x3F) << 6); - $charval += (ord($string{++$i}) & 0x3F); + $charval += ((ord($string[++$i]) & 0x3F) << 12); + $charval += ((ord($string[++$i]) & 0x3F) << 6); + $charval += (ord($string[++$i]) & 0x3F); } elseif ((($char_ord_val & 0xE0) >> 5) == 0x07 && $i+2 < $strlen) { $charval = (($char_ord_val & 0x0F) << 12); - $charval += ((ord($string{++$i}) & 0x3F) << 6); - $charval += (ord($string{++$i}) & 0x3F); + $charval += ((ord($string[++$i]) & 0x3F) << 6); + $charval += (ord($string[++$i]) & 0x3F); } elseif ((($char_ord_val & 0xC0) >> 6) == 0x03 && $i+1 < $strlen) { $charval = (($char_ord_val & 0x1F) << 6); - $charval += (ord($string{++$i}) & 0x3F); + $charval += (ord($string[++$i]) & 0x3F); } if (($charval >= 32) && ($charval <= 127)) { $HTMLstring .= htmlentities(chr($charval)); @@ -1107,7 +1101,6 @@ public static function EmbeddedLookup($key, $begin, $end, $file, $name) { } // Init - $keylength = strlen($key); $line_count = $end - $begin - 7; // Open php file diff --git a/composer.json b/composer.json index 3614442da..0ce37d4fd 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "php": ">=7.2", "aws/aws-sdk-php": "^3.35", "bantu/ini-get-wrapper": "v1.0.1", - "christophwurst/id3parser": "^0.1.0", + "christophwurst/id3parser": "^0.1.1", "deepdiver/zipstreamer": "1.1.1", "deepdiver1975/tarstreamer": "v0.1.0", "doctrine/dbal": "2.9.2", diff --git a/composer.lock b/composer.lock index b8b98c2cb..5ba06758b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "248a1f26b99342588a4a6622193105bb", + "content-hash": "86793509a6f37e184f7404888461262c", "packages": [ { "name": "aws/aws-sdk-php", @@ -121,16 +121,16 @@ }, { "name": "christophwurst/id3parser", - "version": "v0.1.0", + "version": "v0.1.1", "source": { "type": "git", "url": "https://github.com/ChristophWurst/ID3Parser.git", - "reference": "5c655185dea2ce5ca905e223ddbc33f4d815b4de" + "reference": "c0e56c336bd6131c199827f928e5a9aec89aa4da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ChristophWurst/ID3Parser/zipball/5c655185dea2ce5ca905e223ddbc33f4d815b4de", - "reference": "5c655185dea2ce5ca905e223ddbc33f4d815b4de", + "url": "https://api.github.com/repos/ChristophWurst/ID3Parser/zipball/c0e56c336bd6131c199827f928e5a9aec89aa4da", + "reference": "c0e56c336bd6131c199827f928e5a9aec89aa4da", "shasum": "" }, "require": { @@ -153,7 +153,7 @@ "php", "tags" ], - "time": "2019-09-27T10:34:30+00:00" + "time": "2020-01-07T09:05:03+00:00" }, { "name": "deepdiver/zipstreamer", diff --git a/composer/installed.json b/composer/installed.json index d2d5c3655..d146276c3 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -118,23 +118,23 @@ }, { "name": "christophwurst/id3parser", - "version": "v0.1.0", - "version_normalized": "0.1.0.0", + "version": "v0.1.1", + "version_normalized": "0.1.1.0", "source": { "type": "git", "url": "https://github.com/ChristophWurst/ID3Parser.git", - "reference": "5c655185dea2ce5ca905e223ddbc33f4d815b4de" + "reference": "c0e56c336bd6131c199827f928e5a9aec89aa4da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ChristophWurst/ID3Parser/zipball/5c655185dea2ce5ca905e223ddbc33f4d815b4de", - "reference": "5c655185dea2ce5ca905e223ddbc33f4d815b4de", + "url": "https://api.github.com/repos/ChristophWurst/ID3Parser/zipball/c0e56c336bd6131c199827f928e5a9aec89aa4da", + "reference": "c0e56c336bd6131c199827f928e5a9aec89aa4da", "shasum": "" }, "require": { "php": ">=5.4.0" }, - "time": "2019-09-27T10:34:30+00:00", + "time": "2020-01-07T09:05:03+00:00", "type": "library", "installation-source": "dist", "autoload": {