1492 } |
1492 } |
1493 $info['id3v2']['comments']['picture'][] = $comments_picture_data; |
1493 $info['id3v2']['comments']['picture'][] = $comments_picture_data; |
1494 unset($comments_picture_data); |
1494 unset($comments_picture_data); |
1495 } |
1495 } |
1496 } |
1496 } |
1497 } while (false); |
1497 } while (false); // @phpstan-ignore-line |
1498 } |
1498 } |
1499 |
1499 |
1500 } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GEOB')) || // 4.15 GEOB General encapsulated object |
1500 } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GEOB')) || // 4.15 GEOB General encapsulated object |
1501 (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'GEO'))) { // 4.16 GEO General encapsulated object |
1501 (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'GEO'))) { // 4.16 GEO General encapsulated object |
1502 // There may be more than one 'GEOB' frame in each tag, |
1502 // There may be more than one 'GEOB' frame in each tag, |
2062 case 'TIT3': |
2062 case 'TIT3': |
2063 $parsedFrame['chapter_description'] = $encoding_converted_text; |
2063 $parsedFrame['chapter_description'] = $encoding_converted_text; |
2064 $parsedFrame['subframes'][] = $subframe; |
2064 $parsedFrame['subframes'][] = $subframe; |
2065 break; |
2065 break; |
2066 case 'WXXX': |
2066 case 'WXXX': |
2067 list($subframe['chapter_url_description'], $subframe['chapter_url']) = explode("\x00", $encoding_converted_text, 2); |
2067 @list($subframe['chapter_url_description'], $subframe['chapter_url']) = explode("\x00", $encoding_converted_text, 2); |
2068 $parsedFrame['chapter_url'][$subframe['chapter_url_description']] = $subframe['chapter_url']; |
2068 $parsedFrame['chapter_url'][$subframe['chapter_url_description']] = $subframe['chapter_url']; |
2069 $parsedFrame['subframes'][] = $subframe; |
2069 $parsedFrame['subframes'][] = $subframe; |
2070 break; |
2070 break; |
2071 case 'APIC': |
2071 case 'APIC': |
2072 if (preg_match('#^([^\\x00]+)*\\x00(.)([^\\x00]+)*\\x00(.+)$#s', $subframe['text'], $matches)) { |
2072 if (preg_match('#^([^\\x00]+)*\\x00(.)([^\\x00]+)*\\x00(.+)$#s', $subframe['text'], $matches)) { |
3751 * @param bool $allownegative |
3751 * @param bool $allownegative |
3752 * |
3752 * |
3753 * @return bool |
3753 * @return bool |
3754 */ |
3754 */ |
3755 public static function IsANumber($numberstring, $allowdecimal=false, $allownegative=false) { |
3755 public static function IsANumber($numberstring, $allowdecimal=false, $allownegative=false) { |
3756 for ($i = 0; $i < strlen($numberstring); $i++) { |
3756 $pattern = '#^'; |
3757 if ((chr($numberstring[$i]) < chr('0')) || (chr($numberstring[$i]) > chr('9'))) { |
3757 $pattern .= ($allownegative ? '\\-?' : ''); |
3758 if (($numberstring[$i] == '.') && $allowdecimal) { |
3758 $pattern .= '[0-9]+'; |
3759 // allowed |
3759 $pattern .= ($allowdecimal ? '(\\.[0-9]+)?' : ''); |
3760 } elseif (($numberstring[$i] == '-') && $allownegative && ($i == 0)) { |
3760 $pattern .= '$#'; |
3761 // allowed |
3761 return preg_match($pattern, $numberstring); |
3762 } else { |
|
3763 return false; |
|
3764 } |
|
3765 } |
|
3766 } |
|
3767 return true; |
|
3768 } |
3762 } |
3769 |
3763 |
3770 /** |
3764 /** |
3771 * @param string $datestamp |
3765 * @param string $datestamp |
3772 * |
3766 * |
3773 * @return bool |
3767 * @return bool |
3774 */ |
3768 */ |
3775 public static function IsValidDateStampString($datestamp) { |
3769 public static function IsValidDateStampString($datestamp) { |
3776 if (strlen($datestamp) != 8) { |
3770 if (!preg_match('#^[12][0-9]{3}[01][0-9][0123][0-9]$#', $datestamp)) { |
3777 return false; |
|
3778 } |
|
3779 if (!self::IsANumber($datestamp, false)) { |
|
3780 return false; |
3771 return false; |
3781 } |
3772 } |
3782 $year = substr($datestamp, 0, 4); |
3773 $year = substr($datestamp, 0, 4); |
3783 $month = substr($datestamp, 4, 2); |
3774 $month = substr($datestamp, 4, 2); |
3784 $day = substr($datestamp, 6, 2); |
3775 $day = substr($datestamp, 6, 2); |