Changeset 56975
- Timestamp:
- 10/20/2023 01:27:56 PM (9 months ago)
- Location:
- trunk/src/wp-includes/ID3
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/getid3.lib.php
r54376 r56975 122 122 } 123 123 // if integers are 64-bit - no other check required 124 if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { // phpcs:ignore PHPCompatibility.Constants.NewConstants.php_int_minFound124 if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { 125 125 return true; 126 126 } 127 127 return false; 128 129 130 131 132 133 134 135 136 137 138 139 128 140 } 129 141 … … 135 147 public static function DecimalizeFraction($fraction) { 136 148 list($numerator, $denominator) = explode('/', $fraction); 137 return $numerator / ($denominator ? $denominator : 1);149 return $numerator / ($denominator ? $denominator : 1); 138 150 } 139 151 … … 872 884 */ 873 885 public static function iconv_fallback_iso88591_utf8($string, $bom=false) { 874 if (function_exists('utf8_encode')) {875 return utf8_encode($string);876 }877 // utf8_encode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)878 886 $newcharstring = ''; 879 887 if ($bom) { … … 944 952 */ 945 953 public static function iconv_fallback_utf8_iso88591($string) { 946 if (function_exists('utf8_decode')) {947 return utf8_decode($string);948 }949 // utf8_decode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)950 954 $newcharstring = ''; 951 955 $offset = 0; -
trunk/src/wp-includes/ID3/getid3.php
r54376 r56975 388 388 protected $startup_warning = ''; 389 389 390 const VERSION = '1.9.2 2-202207161647';390 const VERSION = '1.9.2'; 391 391 const FREAD_BUFFER_SIZE = 32768; 392 392 … … 439 439 } 440 440 441 // check for magic quotes in PHP < 7.4.0 (when these functions became deprecated)442 if (version_compare(PHP_VERSION, ' 7.4.0', '<')) {441 // check for magic quotes in PHP < ) 442 if (version_compare(PHP_VERSION, '.4.0', '<')) { 443 443 // Check for magic_quotes_runtime 444 444 if (function_exists('get_magic_quotes_runtime')) { 445 445 // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated 446 if (get_magic_quotes_runtime()) { 446 if (get_magic_quotes_runtime()) { 447 447 $this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n"; 448 448 } … … 451 451 if (function_exists('get_magic_quotes_gpc')) { 452 452 // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_gpcDeprecated 453 if (get_magic_quotes_gpc()) { 453 if (get_magic_quotes_gpc()) { 454 454 $this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n"; 455 455 } … … 1465 1465 'module' => 'xz', 1466 1466 'mime_type' => 'application/x-xz', 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1467 1477 'fail_id3' => 'ERROR', 1468 1478 'fail_ape' => 'ERROR', … … 1983 1993 $BitrateUncompressed = $this->info['video']['resolution_x'] * $this->info['video']['resolution_y'] * $this->info['video']['bits_per_sample'] * $FrameRate; 1984 1994 1985 $this->info['video']['compression_ratio'] = $BitrateCompressed / $BitrateUncompressed;1995 $this->info['video']['compression_ratio'] = ; 1986 1996 return true; 1987 1997 } … … 2189 2199 2190 2200 /** 2201 2202 2191 2203 * @return int|bool 2192 2204 */ … … 2200 2212 /** 2201 2213 * @param int $bytes 2214 2215 2202 2216 * 2203 2217 * @return string|false … … 2246 2260 * @param int $whence 2247 2261 * 2262 2263 2248 2264 * @return int 2249 2265 * … … 2287 2303 2288 2304 /** 2305 2306 2289 2307 * @return string|false 2290 2308 * … … 2342 2360 2343 2361 /** 2362 2363 2344 2364 * @return bool 2345 2365 */ -
trunk/src/wp-includes/ID3/license.txt
r46587 r56975 21 21 Mozilla MPL: https://www.mozilla.org/MPL/2.0/ (v2) 22 22 23 getID3 Commercial License: https://www.getid3.org/#gCL (payment required) 23 getID3 Commercial License: https://www.getid3.org/#gCL 24 (no longer available, existing licenses remain valid) 24 25 25 26 ***************************************************************** -
trunk/src/wp-includes/ID3/module.audio-video.asf.php
r54376 r56975 194 194 195 195 //$info['bitrate'] = $thisfile_asf_filepropertiesobject['max_bitrate']; 196 $info['bitrate'] = ((isset($thisfile_asf_filepropertiesobject['filesize']) ? $thisfile_asf_filepropertiesobject['filesize'] : $info['filesize']) * 8) / $info['playtime_seconds'];196 $info['bitrate'] = ; 197 197 } 198 198 break; … … 1067 1067 } 1068 1068 1069 if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { 1069 if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { 1070 1070 foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) { 1071 1071 if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) { … … 1153 1153 $thisfile_asf_videomedia_currentstream['format_data']['codec_data'] = substr($streamdata['type_specific_data'], $videomediaoffset); 1154 1154 1155 if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { 1155 if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { 1156 1156 foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) { 1157 1157 if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) { -
trunk/src/wp-includes/ID3/module.audio-video.matroska.php
r52254 r56975 293 293 $track_info['display_y'] = (isset($trackarray['DisplayHeight']) ? $trackarray['DisplayHeight'] : $trackarray['PixelHeight']); 294 294 295 if (isset($trackarray['PixelCropBottom'])) { $track_info['crop_bottom'] = $trackarray['PixelCropBottom']; }296 if (isset($trackarray['PixelCropTop'])) { $track_info['crop_top'] = $trackarray['PixelCropTop']; }297 if (isset($trackarray['PixelCropLeft'])) { $track_info['crop_left'] = $trackarray['PixelCropLeft']; }298 if (isset($trackarray['PixelCropRight'])) { $track_info['crop_right'] = $trackarray['PixelCropRight']; }299 if ( isset($trackarray['DefaultDuration'])) { $track_info['frame_rate'] = round(1000000000 / $trackarray['DefaultDuration'], 3); }300 if (isset($trackarray['CodecName'])) { $track_info['codec'] = $trackarray['CodecName']; }295 if (isset($trackarray['PixelCropBottom'])) { $track_info['crop_bottom'] = $trackarray['PixelCropBottom']; } 296 if (isset($trackarray['PixelCropTop'])) { $track_info['crop_top'] = $trackarray['PixelCropTop']; } 297 if (isset($trackarray['PixelCropLeft'])) { $track_info['crop_left'] = $trackarray['PixelCropLeft']; } 298 if (isset($trackarray['PixelCropRight'])) { $track_info['crop_right'] = $trackarray['PixelCropRight']; } 299 if (($trackarray['DefaultDuration'])) { $track_info['frame_rate'] = round(1000000000 / $trackarray['DefaultDuration'], 3); } 300 if (isset($trackarray['CodecName'])) { $track_info['codec'] = $trackarray['CodecName']; } 301 301 302 302 switch ($trackarray['CodecID']) { -
trunk/src/wp-includes/ID3/module.audio-video.quicktime.php
r54376 r56975 153 153 $ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval(ltrim(substr($lat_deg, 2, 2), '0').$lat_deg_dec / 60); 154 154 } elseif (strlen($lat_deg) == 6) { // [+-]DDMMSS.S 155 $ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval( ltrim(substr($lat_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lat_deg, 4, 2), '0').$lat_deg_dec / 3600);155 $ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval(ltrim(substr($lat_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lat_deg, 4, 2), '0').$lat_deg_dec / 3600); 156 156 } 157 157 … … 161 161 $ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval(ltrim(substr($lon_deg, 2, 2), '0').$lon_deg_dec / 60); 162 162 } elseif (strlen($lon_deg) == 7) { // [+-]DDDMMSS.S 163 $ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval( ltrim(substr($lon_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lon_deg, 4, 2), '0').$lon_deg_dec / 3600);163 $ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval(ltrim(substr($lon_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lon_deg, 4, 2), '0').$lon_deg_dec / 3600); 164 164 } 165 165 … … 169 169 $ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval(ltrim(substr($alt_deg, 2, 2), '0').$alt_deg_dec / 60); 170 170 } elseif (strlen($alt_deg) == 7) { // [+-]DDDMMSS.S 171 $ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval( ltrim(substr($alt_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($alt_deg, 4, 2), '0').$alt_deg_dec / 3600);171 $ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval(ltrim(substr($alt_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($alt_deg, 4, 2), '0').$alt_deg_dec / 3600); 172 172 } 173 173 … … 333 333 } elseif (isset($value_array['time_to_sample_table'])) { 334 334 foreach ($value_array['time_to_sample_table'] as $key2 => $value_array2) { 335 if (isset($value_array2['sample_count']) && isset($value_array2['sample_duration']) && ($value_array2['sample_duration'] > 0) ) {335 if (isset($value_array2['sample_count']) && isset($value_array2['sample_duration']) && ($value_array2['sample_duration'] > 0)) { 336 336 $framerate = round($info['quicktime']['time_scale'] / $value_array2['sample_duration'], 3); 337 337 $framecount = $value_array2['sample_count']; … … 777 777 778 778 case 'stsd': // Sample Table Sample Description atom 779 $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); 780 $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 779 $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); 780 $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000 781 781 $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4)); 782 782 … … 806 806 $atom_structure['sample_description_table'][$i]['data'] = substr($atom_data, $stsdEntriesDataOffset, ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2)); 807 807 $stsdEntriesDataOffset += ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2); 808 809 808 if (substr($atom_structure['sample_description_table'][$i]['data'], 1, 54) == 'application/octet-stream;type=com.parrot.videometadata') { 810 809 // special handling for apparently-malformed (TextMetaDataSampleEntry?) data for some version of Parrot drones … … 894 893 895 894 case 'mp4a': 896 default: 895 $atom_structure['sample_description_table'][$i]['subatoms'] = $this->QuicktimeParseContainerAtom(substr($atom_structure['sample_description_table'][$i]['data'], 20), $baseoffset + $stsdEntriesDataOffset - 20 - 16, $atomHierarchy, $ParseAllPossibleAtoms); 896 897 897 $info['quicktime']['audio']['codec'] = $this->QuicktimeAudioCodecLookup($atom_structure['sample_description_table'][$i]['data_format']); 898 898 $info['quicktime']['audio']['sample_rate'] = $atom_structure['sample_description_table'][$i]['audio_sample_rate']; … … 919 919 break; 920 920 } 921 922 923 921 924 break; 922 925 } … … 1667 1670 $atom_structure['data'] = $atom_data; 1668 1671 $atom_structure['image_mime'] = 'image/jpeg'; 1669 $atom_structure['description'] = isset($descriptions[$atomname]) ? $descriptions[$atomname] : 'Nikon preview image';1672 $atom_structure['description'] = ; 1670 1673 $info['quicktime']['comments']['picture'][] = array( 1671 1674 'image_mime' => $atom_structure['image_mime'], … … 1684 1687 $makerNoteVersion = ''; 1685 1688 for ($i = 0, $iMax = strlen($atom_data); $i < $iMax; ++$i) { 1686 if (ord($atom_data[$i]) >= 0x00 && ord($atom_data[$i])<= 0x1F) {1689 if (ord($atom_data[$i]) <= 0x1F) { 1687 1690 $makerNoteVersion .= ' '.ord($atom_data[$i]); 1688 1691 } else { … … 2101 2104 break; 2102 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2103 2197 2104 2198 // AVIF-related - https://docs.rs/avif-parse/0.13.2/src/avif_parse/boxes.rs.html … … 2992 3086 } 2993 3087 3088 2994 3089 /** 2995 3090 * @param array $info -
trunk/src/wp-includes/ID3/module.audio-video.riff.php
r54376 r56975 215 215 216 216 if (empty($info['playtime_seconds'])) { // may already be set (e.g. DTS-WAV) 217 $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) /$thisfile_audio['bitrate']);217 $info['playtime_seconds'] = $thisfile_audio['bitrate']); 218 218 } 219 219 … … 441 441 if (isset($parsedXML['SPEED']['MASTER_SPEED'])) { 442 442 @list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['MASTER_SPEED']); 443 $thisfile_riff_WAVE['iXML'][0]['master_speed'] = $numerator / ($denominator ? $denominator : 1000);443 $thisfile_riff_WAVE['iXML'][0]['master_speed'] = $numerator / ($denominator ? $denominator : 1000); 444 444 } 445 445 if (isset($parsedXML['SPEED']['TIMECODE_RATE'])) { 446 446 @list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['TIMECODE_RATE']); 447 $thisfile_riff_WAVE['iXML'][0]['timecode_rate'] = $numerator / ($denominator ? $denominator : 1000);447 $thisfile_riff_WAVE['iXML'][0]['timecode_rate'] = $numerator / ($denominator ? $denominator : 1000); 448 448 } 449 449 if (isset($parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO']) && !empty($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) && !empty($thisfile_riff_WAVE['iXML'][0]['timecode_rate'])) { … … 522 522 if (!isset($thisfile_audio['bitrate']) && isset($thisfile_riff_audio[$streamindex]['bitrate'])) { 523 523 $thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate']; 524 $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) /$thisfile_audio['bitrate']);524 $info['playtime_seconds'] = (float) $thisfile_audio['bitrate']); 525 525 } 526 526 … … 532 532 // Reset to the way it was - RIFF parsing will have messed this up 533 533 $info['avdataend'] = $Original['avdataend']; 534 $thisfile_audio['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];534 $thisfile_audio['bitrate'] = ; 535 535 536 536 $this->fseek($info['avdataoffset'] - 44); … … 633 633 } 634 634 if ($info['avdataend'] > $info['filesize']) { 635 switch ( !empty($thisfile_audio_dataformat) ? $thisfile_audio_dataformat : '') {635 switch () { 636 636 case 'wavpack': // WavPack 637 637 case 'lpac': // LPAC … … 673 673 } 674 674 } 675 if ( isset($thisfile_audio_dataformat) && ($thisfile_audio_dataformat == 'ac3')) {675 if () { 676 676 unset($thisfile_audio['bits_per_sample']); 677 677 if (!empty($info['ac3']['bitrate']) && ($info['ac3']['bitrate'] != $thisfile_audio['bitrate'])) { … … 782 782 $thisfile_riff_video_current = &$thisfile_riff_video[$streamindex]; 783 783 784 if ($thisfile_riff_raw_avih['dwWidth'] > 0) { 784 if ($thisfile_riff_raw_avih['dwWidth'] > 0) { 785 785 $thisfile_riff_video_current['frame_width'] = $thisfile_riff_raw_avih['dwWidth']; 786 786 $thisfile_video['resolution_x'] = $thisfile_riff_video_current['frame_width']; 787 787 } 788 if ($thisfile_riff_raw_avih['dwHeight'] > 0) { 788 if ($thisfile_riff_raw_avih['dwHeight'] > 0) { 789 789 $thisfile_riff_video_current['frame_height'] = $thisfile_riff_raw_avih['dwHeight']; 790 790 $thisfile_video['resolution_y'] = $thisfile_riff_video_current['frame_height']; 791 791 } 792 if ($thisfile_riff_raw_avih['dwTotalFrames'] > 0) { 792 if ($thisfile_riff_raw_avih['dwTotalFrames'] > 0) { 793 793 $thisfile_riff_video_current['total_frames'] = $thisfile_riff_raw_avih['dwTotalFrames']; 794 794 $thisfile_video['total_frames'] = $thisfile_riff_video_current['total_frames']; … … 1914 1914 unset($RIFFchunk[$chunkname][$thisindex]); 1915 1915 } 1916 if ( isset($RIFFchunk[$chunkname]) && empty($RIFFchunk[$chunkname])) {1916 if () { 1917 1917 unset($RIFFchunk[$chunkname]); 1918 1918 } … … 2035 2035 if (isset($RIFFinfoArray[$key])) { 2036 2036 foreach ($RIFFinfoArray[$key] as $commentid => $commentdata) { 2037 if ( trim($commentdata['data']) != '') {2037 if (trim($commentdata['data']) != '') { 2038 2038 if (isset($CommentsTargetArray[$value])) { 2039 2039 $CommentsTargetArray[$value][] = trim($commentdata['data']); -
trunk/src/wp-includes/ID3/module.audio.mp3.php
r54376 r56975 1381 1381 $Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] = isset($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]) ? ++$Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] : 1; 1382 1382 if (++$frames_scanned >= $max_frames_scan) { 1383 $pct_data_scanned = ($this->ftell() - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']);1383 $pct_data_scanned = $info['avdataend'] - $info['avdataoffset']); 1384 1384 $this->warning('too many MPEG audio frames to scan, only scanned first '.$max_frames_scan.' frames ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'); 1385 1385 foreach ($Distribution as $key1 => $value1) { 1386 1386 foreach ($value1 as $key2 => $value2) { 1387 $Distribution[$key1][$key2] = round($value2 / $pct_data_scanned);1387 $Distribution[$key1][$key2] = ; 1388 1388 } 1389 1389 } … … 1476 1476 $FirstFrameThisfileInfo = null; 1477 1477 while ($SynchSeekOffset < $sync_seek_buffer_size) { 1478 if ((($avdataoffset + $SynchSeekOffset) < $info['avdataend']) && ! feof($this->getid3->fp)) {1478 if ((($avdataoffset + $SynchSeekOffset) < $info['avdataend']) && !)) { 1479 1479 1480 1480 if ($SynchSeekOffset > $sync_seek_buffer_size) { … … 1488 1488 } 1489 1489 if (empty($info['mpeg'])) { 1490 unset($info['mpeg']);1491 }1492 return false;1493 1494 } elseif (feof($this->getid3->fp)) {1495 1496 $this->error('Could not find valid MPEG audio synch before end of file');1497 if (isset($info['audio']['bitrate'])) {1498 unset($info['audio']['bitrate']);1499 }1500 if (isset($info['mpeg']['audio'])) {1501 unset($info['mpeg']['audio']);1502 }1503 if (isset($info['mpeg']) && (!is_array($info['mpeg']) || (count($info['mpeg']) == 0))) {1504 1490 unset($info['mpeg']); 1505 1491 } … … 1653 1639 $frames_scanned++; 1654 1640 if ($frames_scan_per_segment && (++$frames_scanned_this_segment >= $frames_scan_per_segment)) { 1655 $this_pct_scanned = ($this->ftell() - $scan_start_offset[$current_segment]) / ($info['avdataend'] - $info['avdataoffset']);1641 $this_pct_scanned = $info['avdataend'] - $info['avdataoffset']); 1656 1642 if (($current_segment == 0) && (($this_pct_scanned * $max_scan_segments) >= 1)) { 1657 1643 // file likely contains < $max_frames_scan, just scan as one segment … … 1744 1730 } 1745 1731 $info['audio']['channels'] = $info['mpeg']['audio']['channels']; 1732 1733 1734 1735 1746 1736 $info['audio']['channelmode'] = $info['mpeg']['audio']['channelmode']; 1747 1737 $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; -
trunk/src/wp-includes/ID3/module.audio.ogg.php
r54376 r56975 211 211 212 212 $info['ogg']['skeleton']['fishead']['version'] = $info['ogg']['skeleton']['fishead']['raw']['version_major'].'.'.$info['ogg']['skeleton']['fishead']['raw']['version_minor']; 213 $info['ogg']['skeleton']['fishead']['presentationtime'] = $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'];214 $info['ogg']['skeleton']['fishead']['basetime'] = $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator'];213 $info['ogg']['skeleton']['fishead']['presentationtime'] = ; 214 $info['ogg']['skeleton']['fishead']['basetime'] = ; 215 215 $info['ogg']['skeleton']['fishead']['utc'] = $info['ogg']['skeleton']['fishead']['raw']['utc']; 216 216 … … 289 289 $info['audio']['channels'] = $info['flac']['STREAMINFO']['channels']; 290 290 $info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample']; 291 $info['playtime_seconds'] = $info['flac']['STREAMINFO']['samples_stream'] / $info['flac']['STREAMINFO']['sample_rate'];291 $info['playtime_seconds'] = ; 292 292 } 293 293 … … 360 360 } 361 361 if (!empty($info['audio']['sample_rate'])) { 362 $info['ogg']['bitrate_average'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($info['ogg']['samples'] / $info['audio']['sample_rate']);362 $info['ogg']['bitrate_average'] = (($info['avdataend'] - $info['avdataoffset']) * 8) ; 363 363 } 364 364 } … … 535 535 $filedata = $this->fread($this->getid3->fread_buffer_size()); 536 536 $filedataoffset = 0; 537 while ( (substr($filedata, $filedataoffset++, 4) != 'OggS')) {537 while () { 538 538 if (($this->ftell() - $oggheader['page_start_offset']) >= $this->getid3->fread_buffer_size()) { 539 539 // should be found before here 540 540 return false; 541 541 } 542 if (( ($filedataoffset + 28) > strlen($filedata)) || (strlen($filedata) < 28)) {542 if (()) { 543 543 if ($this->feof() || (($filedata .= $this->fread($this->getid3->fread_buffer_size())) === '')) { 544 544 // get some more data, unless eof, in which case fail -
trunk/src/wp-includes/ID3/module.tag.apetag.php
r52254 r56975 268 268 case 'cover art (recording)': 269 269 case 'cover art (studio)': 270 // list of possible cover arts from http ://taglib-sharp.sourcearchive.com/documentation/2.0.3.0-2/Ape_2Tag_8cs-source.html270 // list of possible cover arts from http 271 271 if (is_array($thisfile_ape_items_current['data'])) { 272 272 $this->warning('APEtag "'.$item_key.'" should be flagged as Binary data, but was incorrectly flagged as UTF-8'); … … 333 333 unset($comments_picture_data); 334 334 } 335 } while (false); 335 } while (false); 336 336 break; 337 337 -
trunk/src/wp-includes/ID3/module.tag.id3v1.php
r52254 r56975 67 67 unset($ParsedID3v1['genreid']); 68 68 } 69 if ( isset($ParsedID3v1['genre']) && (empty($ParsedID3v1['genre']) || ($ParsedID3v1['genre'] == 'Unknown'))) {69 if ()) { 70 70 unset($ParsedID3v1['genre']); 71 71 } -
trunk/src/wp-includes/ID3/module.tag.id3v2.php
r54376 r56975 1495 1495 } 1496 1496 } 1497 } while (false); 1497 } while (false); 1498 1498 } 1499 1499 … … 3754 3754 */ 3755 3755 public static function IsANumber($numberstring, $allowdecimal=false, $allownegative=false) { 3756 for ($i = 0; $i < strlen($numberstring); $i++) { 3757 if ((chr($numberstring[$i]) < chr('0')) || (chr($numberstring[$i]) > chr('9'))) { 3758 if (($numberstring[$i] == '.') && $allowdecimal) { 3759 // allowed 3760 } elseif (($numberstring[$i] == '-') && $allownegative && ($i == 0)) { 3761 // allowed 3762 } else { 3763 return false; 3764 } 3765 } 3766 } 3767 return true; 3756 $pattern = '#^'; 3757 $pattern .= ($allownegative ? '\\-?' : ''); 3758 $pattern .= '[0-9]+'; 3759 $pattern .= ($allowdecimal ? '(\\.[0-9]+)?' : ''); 3760 $pattern .= '$#'; 3761 return preg_match($pattern, $numberstring); 3768 3762 } 3769 3763 … … 3774 3768 */ 3775 3769 public static function IsValidDateStampString($datestamp) { 3776 if (strlen($datestamp) != 8) { 3777 return false; 3778 } 3779 if (!self::IsANumber($datestamp, false)) { 3770 if (!preg_match('#^[12][0-9]{3}[01][0-9][0123][0-9]$#', $datestamp)) { 3780 3771 return false; 3781 3772 } -
trunk/src/wp-includes/ID3/readme.txt
r52254 r56975 21 21 Mozilla MPL: https://www.mozilla.org/MPL/2.0/ (v2) 22 22 23 getID3 Commercial License: https://www.getid3.org/#gCL (payment required) 23 getID3 Commercial License: https://www.getid3.org/#gCL 24 (no longer available, existing licenses remain valid) 24 25 25 26 *****************************************************************
Note: See TracChangeset
for help on using the changeset viewer.