Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../ID3
File: getid3.php
}
[500] Fix | Delete
}
[501] Fix | Delete
$path_so_far[] = $value;
[502] Fix | Delete
}
[503] Fix | Delete
$helperappsdir = implode(DIRECTORY_SEPARATOR, $path_so_far);
[504] Fix | Delete
}
[505] Fix | Delete
define('GETID3_HELPERAPPSDIR', $helperappsdir.DIRECTORY_SEPARATOR);
[506] Fix | Delete
}
[507] Fix | Delete
[508] Fix | Delete
if (!empty($this->startup_error)) {
[509] Fix | Delete
echo $this->startup_error;
[510] Fix | Delete
throw new getid3_exception($this->startup_error);
[511] Fix | Delete
}
[512] Fix | Delete
}
[513] Fix | Delete
[514] Fix | Delete
/**
[515] Fix | Delete
* @return string
[516] Fix | Delete
*/
[517] Fix | Delete
public function version() {
[518] Fix | Delete
return self::VERSION;
[519] Fix | Delete
}
[520] Fix | Delete
[521] Fix | Delete
/**
[522] Fix | Delete
* @return int
[523] Fix | Delete
*/
[524] Fix | Delete
public function fread_buffer_size() {
[525] Fix | Delete
return $this->option_fread_buffer_size;
[526] Fix | Delete
}
[527] Fix | Delete
[528] Fix | Delete
/**
[529] Fix | Delete
* @param array $optArray
[530] Fix | Delete
*
[531] Fix | Delete
* @return bool
[532] Fix | Delete
*/
[533] Fix | Delete
public function setOption($optArray) {
[534] Fix | Delete
if (!is_array($optArray) || empty($optArray)) {
[535] Fix | Delete
return false;
[536] Fix | Delete
}
[537] Fix | Delete
foreach ($optArray as $opt => $val) {
[538] Fix | Delete
if (isset($this->$opt) === false) {
[539] Fix | Delete
continue;
[540] Fix | Delete
}
[541] Fix | Delete
$this->$opt = $val;
[542] Fix | Delete
}
[543] Fix | Delete
return true;
[544] Fix | Delete
}
[545] Fix | Delete
[546] Fix | Delete
/**
[547] Fix | Delete
* @param string $filename
[548] Fix | Delete
* @param int $filesize
[549] Fix | Delete
* @param resource $fp
[550] Fix | Delete
*
[551] Fix | Delete
* @return bool
[552] Fix | Delete
*
[553] Fix | Delete
* @throws getid3_exception
[554] Fix | Delete
*/
[555] Fix | Delete
public function openfile($filename, $filesize=null, $fp=null) {
[556] Fix | Delete
try {
[557] Fix | Delete
if (!empty($this->startup_error)) {
[558] Fix | Delete
throw new getid3_exception($this->startup_error);
[559] Fix | Delete
}
[560] Fix | Delete
if (!empty($this->startup_warning)) {
[561] Fix | Delete
foreach (explode("\n", $this->startup_warning) as $startup_warning) {
[562] Fix | Delete
$this->warning($startup_warning);
[563] Fix | Delete
}
[564] Fix | Delete
}
[565] Fix | Delete
[566] Fix | Delete
// init result array and set parameters
[567] Fix | Delete
$this->filename = $filename;
[568] Fix | Delete
$this->info = array();
[569] Fix | Delete
$this->info['GETID3_VERSION'] = $this->version();
[570] Fix | Delete
$this->info['php_memory_limit'] = (($this->memory_limit > 0) ? $this->memory_limit : false);
[571] Fix | Delete
[572] Fix | Delete
// remote files not supported
[573] Fix | Delete
if (preg_match('#^(ht|f)tps?://#', $filename)) {
[574] Fix | Delete
throw new getid3_exception('Remote files are not supported - please copy the file locally first');
[575] Fix | Delete
}
[576] Fix | Delete
[577] Fix | Delete
$filename = str_replace('/', DIRECTORY_SEPARATOR, $filename);
[578] Fix | Delete
//$filename = preg_replace('#(?<!gs:)('.preg_quote(DIRECTORY_SEPARATOR).'{2,})#', DIRECTORY_SEPARATOR, $filename);
[579] Fix | Delete
[580] Fix | Delete
// open local file
[581] Fix | Delete
//if (is_readable($filename) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) { // see https://www.getid3.org/phpBB3/viewtopic.php?t=1720
[582] Fix | Delete
if (($fp != null) && ((get_resource_type($fp) == 'file') || (get_resource_type($fp) == 'stream'))) {
[583] Fix | Delete
$this->fp = $fp;
[584] Fix | Delete
} elseif ((is_readable($filename) || file_exists($filename)) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) {
[585] Fix | Delete
// great
[586] Fix | Delete
} else {
[587] Fix | Delete
$errormessagelist = array();
[588] Fix | Delete
if (!is_readable($filename)) {
[589] Fix | Delete
$errormessagelist[] = '!is_readable';
[590] Fix | Delete
}
[591] Fix | Delete
if (!is_file($filename)) {
[592] Fix | Delete
$errormessagelist[] = '!is_file';
[593] Fix | Delete
}
[594] Fix | Delete
if (!file_exists($filename)) {
[595] Fix | Delete
$errormessagelist[] = '!file_exists';
[596] Fix | Delete
}
[597] Fix | Delete
if (empty($errormessagelist)) {
[598] Fix | Delete
$errormessagelist[] = 'fopen failed';
[599] Fix | Delete
}
[600] Fix | Delete
throw new getid3_exception('Could not open "'.$filename.'" ('.implode('; ', $errormessagelist).')');
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
$this->info['filesize'] = (!is_null($filesize) ? $filesize : filesize($filename));
[604] Fix | Delete
// set redundant parameters - might be needed in some include file
[605] Fix | Delete
// filenames / filepaths in getID3 are always expressed with forward slashes (unix-style) for both Windows and other to try and minimize confusion
[606] Fix | Delete
$filename = str_replace('\\', '/', $filename);
[607] Fix | Delete
$this->info['filepath'] = str_replace('\\', '/', realpath(dirname($filename)));
[608] Fix | Delete
$this->info['filename'] = getid3_lib::mb_basename($filename);
[609] Fix | Delete
$this->info['filenamepath'] = $this->info['filepath'].'/'.$this->info['filename'];
[610] Fix | Delete
[611] Fix | Delete
// set more parameters
[612] Fix | Delete
$this->info['avdataoffset'] = 0;
[613] Fix | Delete
$this->info['avdataend'] = $this->info['filesize'];
[614] Fix | Delete
$this->info['fileformat'] = ''; // filled in later
[615] Fix | Delete
$this->info['audio']['dataformat'] = ''; // filled in later, unset if not used
[616] Fix | Delete
$this->info['video']['dataformat'] = ''; // filled in later, unset if not used
[617] Fix | Delete
$this->info['tags'] = array(); // filled in later, unset if not used
[618] Fix | Delete
$this->info['error'] = array(); // filled in later, unset if not used
[619] Fix | Delete
$this->info['warning'] = array(); // filled in later, unset if not used
[620] Fix | Delete
$this->info['comments'] = array(); // filled in later, unset if not used
[621] Fix | Delete
$this->info['encoding'] = $this->encoding; // required by id3v2 and iso modules - can be unset at the end if desired
[622] Fix | Delete
[623] Fix | Delete
// option_max_2gb_check
[624] Fix | Delete
if ($this->option_max_2gb_check) {
[625] Fix | Delete
// PHP (32-bit all, and 64-bit Windows) doesn't support integers larger than 2^31 (~2GB)
[626] Fix | Delete
// filesize() simply returns (filesize % (pow(2, 32)), no matter the actual filesize
[627] Fix | Delete
// ftell() returns 0 if seeking to the end is beyond the range of unsigned integer
[628] Fix | Delete
$fseek = fseek($this->fp, 0, SEEK_END);
[629] Fix | Delete
if (($fseek < 0) || (($this->info['filesize'] != 0) && (ftell($this->fp) == 0)) ||
[630] Fix | Delete
($this->info['filesize'] < 0) ||
[631] Fix | Delete
(ftell($this->fp) < 0)) {
[632] Fix | Delete
$real_filesize = getid3_lib::getFileSizeSyscall($this->info['filenamepath']);
[633] Fix | Delete
[634] Fix | Delete
if ($real_filesize === false) {
[635] Fix | Delete
unset($this->info['filesize']);
[636] Fix | Delete
fclose($this->fp);
[637] Fix | Delete
throw new getid3_exception('Unable to determine actual filesize. File is most likely larger than '.round(PHP_INT_MAX / 1073741824).'GB and is not supported by PHP.');
[638] Fix | Delete
} elseif (getid3_lib::intValueSupported($real_filesize)) {
[639] Fix | Delete
unset($this->info['filesize']);
[640] Fix | Delete
fclose($this->fp);
[641] Fix | Delete
throw new getid3_exception('PHP seems to think the file is larger than '.round(PHP_INT_MAX / 1073741824).'GB, but filesystem reports it as '.number_format($real_filesize / 1073741824, 3).'GB, please report to info@getid3.org');
[642] Fix | Delete
}
[643] Fix | Delete
$this->info['filesize'] = $real_filesize;
[644] Fix | Delete
$this->warning('File is larger than '.round(PHP_INT_MAX / 1073741824).'GB (filesystem reports it as '.number_format($real_filesize / 1073741824, 3).'GB) and is not properly supported by PHP.');
[645] Fix | Delete
}
[646] Fix | Delete
}
[647] Fix | Delete
[648] Fix | Delete
return true;
[649] Fix | Delete
[650] Fix | Delete
} catch (Exception $e) {
[651] Fix | Delete
$this->error($e->getMessage());
[652] Fix | Delete
}
[653] Fix | Delete
return false;
[654] Fix | Delete
}
[655] Fix | Delete
[656] Fix | Delete
/**
[657] Fix | Delete
* analyze file
[658] Fix | Delete
*
[659] Fix | Delete
* @param string $filename
[660] Fix | Delete
* @param int $filesize
[661] Fix | Delete
* @param string $original_filename
[662] Fix | Delete
* @param resource $fp
[663] Fix | Delete
*
[664] Fix | Delete
* @return array
[665] Fix | Delete
*/
[666] Fix | Delete
public function analyze($filename, $filesize=null, $original_filename='', $fp=null) {
[667] Fix | Delete
try {
[668] Fix | Delete
if (!$this->openfile($filename, $filesize, $fp)) {
[669] Fix | Delete
return $this->info;
[670] Fix | Delete
}
[671] Fix | Delete
[672] Fix | Delete
// Handle tags
[673] Fix | Delete
foreach (array('id3v2'=>'id3v2', 'id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) {
[674] Fix | Delete
$option_tag = 'option_tag_'.$tag_name;
[675] Fix | Delete
if ($this->$option_tag) {
[676] Fix | Delete
$this->include_module('tag.'.$tag_name);
[677] Fix | Delete
try {
[678] Fix | Delete
$tag_class = 'getid3_'.$tag_name;
[679] Fix | Delete
$tag = new $tag_class($this);
[680] Fix | Delete
$tag->Analyze();
[681] Fix | Delete
}
[682] Fix | Delete
catch (getid3_exception $e) {
[683] Fix | Delete
throw $e;
[684] Fix | Delete
}
[685] Fix | Delete
}
[686] Fix | Delete
}
[687] Fix | Delete
if (isset($this->info['id3v2']['tag_offset_start'])) {
[688] Fix | Delete
$this->info['avdataoffset'] = max($this->info['avdataoffset'], $this->info['id3v2']['tag_offset_end']);
[689] Fix | Delete
}
[690] Fix | Delete
foreach (array('id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) {
[691] Fix | Delete
if (isset($this->info[$tag_key]['tag_offset_start'])) {
[692] Fix | Delete
$this->info['avdataend'] = min($this->info['avdataend'], $this->info[$tag_key]['tag_offset_start']);
[693] Fix | Delete
}
[694] Fix | Delete
}
[695] Fix | Delete
[696] Fix | Delete
// ID3v2 detection (NOT parsing), even if ($this->option_tag_id3v2 == false) done to make fileformat easier
[697] Fix | Delete
if (!$this->option_tag_id3v2) {
[698] Fix | Delete
fseek($this->fp, 0);
[699] Fix | Delete
$header = fread($this->fp, 10);
[700] Fix | Delete
if ((substr($header, 0, 3) == 'ID3') && (strlen($header) == 10)) {
[701] Fix | Delete
$this->info['id3v2']['header'] = true;
[702] Fix | Delete
$this->info['id3v2']['majorversion'] = ord($header[3]);
[703] Fix | Delete
$this->info['id3v2']['minorversion'] = ord($header[4]);
[704] Fix | Delete
$this->info['avdataoffset'] += getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length
[705] Fix | Delete
}
[706] Fix | Delete
}
[707] Fix | Delete
[708] Fix | Delete
// read 32 kb file data
[709] Fix | Delete
fseek($this->fp, $this->info['avdataoffset']);
[710] Fix | Delete
$formattest = fread($this->fp, 32774);
[711] Fix | Delete
[712] Fix | Delete
// determine format
[713] Fix | Delete
$determined_format = $this->GetFileFormat($formattest, ($original_filename ? $original_filename : $filename));
[714] Fix | Delete
[715] Fix | Delete
// unable to determine file format
[716] Fix | Delete
if (!$determined_format) {
[717] Fix | Delete
fclose($this->fp);
[718] Fix | Delete
return $this->error('unable to determine file format');
[719] Fix | Delete
}
[720] Fix | Delete
[721] Fix | Delete
// check for illegal ID3 tags
[722] Fix | Delete
if (isset($determined_format['fail_id3']) && (in_array('id3v1', $this->info['tags']) || in_array('id3v2', $this->info['tags']))) {
[723] Fix | Delete
if ($determined_format['fail_id3'] === 'ERROR') {
[724] Fix | Delete
fclose($this->fp);
[725] Fix | Delete
return $this->error('ID3 tags not allowed on this file type.');
[726] Fix | Delete
} elseif ($determined_format['fail_id3'] === 'WARNING') {
[727] Fix | Delete
$this->warning('ID3 tags not allowed on this file type.');
[728] Fix | Delete
}
[729] Fix | Delete
}
[730] Fix | Delete
[731] Fix | Delete
// check for illegal APE tags
[732] Fix | Delete
if (isset($determined_format['fail_ape']) && in_array('ape', $this->info['tags'])) {
[733] Fix | Delete
if ($determined_format['fail_ape'] === 'ERROR') {
[734] Fix | Delete
fclose($this->fp);
[735] Fix | Delete
return $this->error('APE tags not allowed on this file type.');
[736] Fix | Delete
} elseif ($determined_format['fail_ape'] === 'WARNING') {
[737] Fix | Delete
$this->warning('APE tags not allowed on this file type.');
[738] Fix | Delete
}
[739] Fix | Delete
}
[740] Fix | Delete
[741] Fix | Delete
// set mime type
[742] Fix | Delete
$this->info['mime_type'] = $determined_format['mime_type'];
[743] Fix | Delete
[744] Fix | Delete
// supported format signature pattern detected, but module deleted
[745] Fix | Delete
if (!file_exists(GETID3_INCLUDEPATH.$determined_format['include'])) {
[746] Fix | Delete
fclose($this->fp);
[747] Fix | Delete
return $this->error('Format not supported, module "'.$determined_format['include'].'" was removed.');
[748] Fix | Delete
}
[749] Fix | Delete
[750] Fix | Delete
// module requires mb_convert_encoding/iconv support
[751] Fix | Delete
// Check encoding/iconv support
[752] Fix | Delete
if (!empty($determined_format['iconv_req']) && !function_exists('mb_convert_encoding') && !function_exists('iconv') && !in_array($this->encoding, array('ISO-8859-1', 'UTF-8', 'UTF-16LE', 'UTF-16BE', 'UTF-16'))) {
[753] Fix | Delete
$errormessage = 'mb_convert_encoding() or iconv() support is required for this module ('.$determined_format['include'].') for encodings other than ISO-8859-1, UTF-8, UTF-16LE, UTF16-BE, UTF-16. ';
[754] Fix | Delete
if (GETID3_OS_ISWINDOWS) {
[755] Fix | Delete
$errormessage .= 'PHP does not have mb_convert_encoding() or iconv() support. Please enable php_mbstring.dll / php_iconv.dll in php.ini, and copy php_mbstring.dll / iconv.dll from c:/php/dlls to c:/windows/system32';
[756] Fix | Delete
} else {
[757] Fix | Delete
$errormessage .= 'PHP is not compiled with mb_convert_encoding() or iconv() support. Please recompile with the --enable-mbstring / --with-iconv switch';
[758] Fix | Delete
}
[759] Fix | Delete
return $this->error($errormessage);
[760] Fix | Delete
}
[761] Fix | Delete
[762] Fix | Delete
// include module
[763] Fix | Delete
include_once(GETID3_INCLUDEPATH.$determined_format['include']);
[764] Fix | Delete
[765] Fix | Delete
// instantiate module class
[766] Fix | Delete
$class_name = 'getid3_'.$determined_format['module'];
[767] Fix | Delete
if (!class_exists($class_name)) {
[768] Fix | Delete
return $this->error('Format not supported, module "'.$determined_format['include'].'" is corrupt.');
[769] Fix | Delete
}
[770] Fix | Delete
$class = new $class_name($this);
[771] Fix | Delete
[772] Fix | Delete
// set module-specific options
[773] Fix | Delete
foreach (get_object_vars($this) as $getid3_object_vars_key => $getid3_object_vars_value) {
[774] Fix | Delete
if (preg_match('#^options_([^_]+)_([^_]+)_(.+)$#i', $getid3_object_vars_key, $matches)) {
[775] Fix | Delete
list($dummy, $GOVgroup, $GOVmodule, $GOVsetting) = $matches;
[776] Fix | Delete
$GOVgroup = (($GOVgroup == 'audiovideo') ? 'audio-video' : $GOVgroup); // variable names can only contain 0-9a-z_ so standardize here
[777] Fix | Delete
if (($GOVgroup == $determined_format['group']) && ($GOVmodule == $determined_format['module'])) {
[778] Fix | Delete
$class->$GOVsetting = $getid3_object_vars_value;
[779] Fix | Delete
}
[780] Fix | Delete
}
[781] Fix | Delete
}
[782] Fix | Delete
[783] Fix | Delete
$class->Analyze();
[784] Fix | Delete
unset($class);
[785] Fix | Delete
[786] Fix | Delete
// close file
[787] Fix | Delete
fclose($this->fp);
[788] Fix | Delete
[789] Fix | Delete
// process all tags - copy to 'tags' and convert charsets
[790] Fix | Delete
if ($this->option_tags_process) {
[791] Fix | Delete
$this->HandleAllTags();
[792] Fix | Delete
}
[793] Fix | Delete
[794] Fix | Delete
// perform more calculations
[795] Fix | Delete
if ($this->option_extra_info) {
[796] Fix | Delete
$this->ChannelsBitratePlaytimeCalculations();
[797] Fix | Delete
$this->CalculateCompressionRatioVideo();
[798] Fix | Delete
$this->CalculateCompressionRatioAudio();
[799] Fix | Delete
$this->CalculateReplayGain();
[800] Fix | Delete
$this->ProcessAudioStreams();
[801] Fix | Delete
}
[802] Fix | Delete
[803] Fix | Delete
// get the MD5 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags
[804] Fix | Delete
if ($this->option_md5_data) {
[805] Fix | Delete
// do not calc md5_data if md5_data_source is present - set by flac only - future MPC/SV8 too
[806] Fix | Delete
if (!$this->option_md5_data_source || empty($this->info['md5_data_source'])) {
[807] Fix | Delete
$this->getHashdata('md5');
[808] Fix | Delete
}
[809] Fix | Delete
}
[810] Fix | Delete
[811] Fix | Delete
// get the SHA1 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags
[812] Fix | Delete
if ($this->option_sha1_data) {
[813] Fix | Delete
$this->getHashdata('sha1');
[814] Fix | Delete
}
[815] Fix | Delete
[816] Fix | Delete
// remove undesired keys
[817] Fix | Delete
$this->CleanUp();
[818] Fix | Delete
[819] Fix | Delete
} catch (Exception $e) {
[820] Fix | Delete
$this->error('Caught exception: '.$e->getMessage());
[821] Fix | Delete
}
[822] Fix | Delete
[823] Fix | Delete
// return info array
[824] Fix | Delete
return $this->info;
[825] Fix | Delete
}
[826] Fix | Delete
[827] Fix | Delete
[828] Fix | Delete
/**
[829] Fix | Delete
* Error handling.
[830] Fix | Delete
*
[831] Fix | Delete
* @param string $message
[832] Fix | Delete
*
[833] Fix | Delete
* @return array
[834] Fix | Delete
*/
[835] Fix | Delete
public function error($message) {
[836] Fix | Delete
$this->CleanUp();
[837] Fix | Delete
if (!isset($this->info['error'])) {
[838] Fix | Delete
$this->info['error'] = array();
[839] Fix | Delete
}
[840] Fix | Delete
$this->info['error'][] = $message;
[841] Fix | Delete
return $this->info;
[842] Fix | Delete
}
[843] Fix | Delete
[844] Fix | Delete
[845] Fix | Delete
/**
[846] Fix | Delete
* Warning handling.
[847] Fix | Delete
*
[848] Fix | Delete
* @param string $message
[849] Fix | Delete
*
[850] Fix | Delete
* @return bool
[851] Fix | Delete
*/
[852] Fix | Delete
public function warning($message) {
[853] Fix | Delete
$this->info['warning'][] = $message;
[854] Fix | Delete
return true;
[855] Fix | Delete
}
[856] Fix | Delete
[857] Fix | Delete
[858] Fix | Delete
/**
[859] Fix | Delete
* @return bool
[860] Fix | Delete
*/
[861] Fix | Delete
private function CleanUp() {
[862] Fix | Delete
[863] Fix | Delete
// remove possible empty keys
[864] Fix | Delete
$AVpossibleEmptyKeys = array('dataformat', 'bits_per_sample', 'encoder_options', 'streams', 'bitrate');
[865] Fix | Delete
foreach ($AVpossibleEmptyKeys as $dummy => $key) {
[866] Fix | Delete
if (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) {
[867] Fix | Delete
unset($this->info['audio'][$key]);
[868] Fix | Delete
}
[869] Fix | Delete
if (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) {
[870] Fix | Delete
unset($this->info['video'][$key]);
[871] Fix | Delete
}
[872] Fix | Delete
}
[873] Fix | Delete
[874] Fix | Delete
// remove empty root keys
[875] Fix | Delete
if (!empty($this->info)) {
[876] Fix | Delete
foreach ($this->info as $key => $value) {
[877] Fix | Delete
if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {
[878] Fix | Delete
unset($this->info[$key]);
[879] Fix | Delete
}
[880] Fix | Delete
}
[881] Fix | Delete
}
[882] Fix | Delete
[883] Fix | Delete
// remove meaningless entries from unknown-format files
[884] Fix | Delete
if (empty($this->info['fileformat'])) {
[885] Fix | Delete
if (isset($this->info['avdataoffset'])) {
[886] Fix | Delete
unset($this->info['avdataoffset']);
[887] Fix | Delete
}
[888] Fix | Delete
if (isset($this->info['avdataend'])) {
[889] Fix | Delete
unset($this->info['avdataend']);
[890] Fix | Delete
}
[891] Fix | Delete
}
[892] Fix | Delete
[893] Fix | Delete
// remove possible duplicated identical entries
[894] Fix | Delete
if (!empty($this->info['error'])) {
[895] Fix | Delete
$this->info['error'] = array_values(array_unique($this->info['error']));
[896] Fix | Delete
}
[897] Fix | Delete
if (!empty($this->info['warning'])) {
[898] Fix | Delete
$this->info['warning'] = array_values(array_unique($this->info['warning']));
[899] Fix | Delete
}
[900] Fix | Delete
[901] Fix | Delete
// remove "global variable" type keys
[902] Fix | Delete
unset($this->info['php_memory_limit']);
[903] Fix | Delete
[904] Fix | Delete
return true;
[905] Fix | Delete
}
[906] Fix | Delete
[907] Fix | Delete
/**
[908] Fix | Delete
* Return array containing information about all supported formats.
[909] Fix | Delete
*
[910] Fix | Delete
* @return array
[911] Fix | Delete
*/
[912] Fix | Delete
public function GetFileFormatArray() {
[913] Fix | Delete
static $format_info = array();
[914] Fix | Delete
if (empty($format_info)) {
[915] Fix | Delete
$format_info = array(
[916] Fix | Delete
[917] Fix | Delete
// Audio formats
[918] Fix | Delete
[919] Fix | Delete
// AC-3 - audio - Dolby AC-3 / Dolby Digital
[920] Fix | Delete
'ac3' => array(
[921] Fix | Delete
'pattern' => '^\\x0B\\x77',
[922] Fix | Delete
'group' => 'audio',
[923] Fix | Delete
'module' => 'ac3',
[924] Fix | Delete
'mime_type' => 'audio/ac3',
[925] Fix | Delete
),
[926] Fix | Delete
[927] Fix | Delete
// AAC - audio - Advanced Audio Coding (AAC) - ADIF format
[928] Fix | Delete
'adif' => array(
[929] Fix | Delete
'pattern' => '^ADIF',
[930] Fix | Delete
'group' => 'audio',
[931] Fix | Delete
'module' => 'aac',
[932] Fix | Delete
'mime_type' => 'audio/aac',
[933] Fix | Delete
'fail_ape' => 'WARNING',
[934] Fix | Delete
),
[935] Fix | Delete
[936] Fix | Delete
/*
[937] Fix | Delete
// AA - audio - Audible Audiobook
[938] Fix | Delete
'aa' => array(
[939] Fix | Delete
'pattern' => '^.{4}\\x57\\x90\\x75\\x36',
[940] Fix | Delete
'group' => 'audio',
[941] Fix | Delete
'module' => 'aa',
[942] Fix | Delete
'mime_type' => 'audio/audible',
[943] Fix | Delete
),
[944] Fix | Delete
*/
[945] Fix | Delete
// AAC - audio - Advanced Audio Coding (AAC) - ADTS format (very similar to MP3)
[946] Fix | Delete
'adts' => array(
[947] Fix | Delete
'pattern' => '^\\xFF[\\xF0-\\xF1\\xF8-\\xF9]',
[948] Fix | Delete
'group' => 'audio',
[949] Fix | Delete
'module' => 'aac',
[950] Fix | Delete
'mime_type' => 'audio/aac',
[951] Fix | Delete
'fail_ape' => 'WARNING',
[952] Fix | Delete
),
[953] Fix | Delete
[954] Fix | Delete
[955] Fix | Delete
// AU - audio - NeXT/Sun AUdio (AU)
[956] Fix | Delete
'au' => array(
[957] Fix | Delete
'pattern' => '^\\.snd',
[958] Fix | Delete
'group' => 'audio',
[959] Fix | Delete
'module' => 'au',
[960] Fix | Delete
'mime_type' => 'audio/basic',
[961] Fix | Delete
),
[962] Fix | Delete
[963] Fix | Delete
// AMR - audio - Adaptive Multi Rate
[964] Fix | Delete
'amr' => array(
[965] Fix | Delete
'pattern' => '^\\x23\\x21AMR\\x0A', // #!AMR[0A]
[966] Fix | Delete
'group' => 'audio',
[967] Fix | Delete
'module' => 'amr',
[968] Fix | Delete
'mime_type' => 'audio/amr',
[969] Fix | Delete
),
[970] Fix | Delete
[971] Fix | Delete
// AVR - audio - Audio Visual Research
[972] Fix | Delete
'avr' => array(
[973] Fix | Delete
'pattern' => '^2BIT',
[974] Fix | Delete
'group' => 'audio',
[975] Fix | Delete
'module' => 'avr',
[976] Fix | Delete
'mime_type' => 'application/octet-stream',
[977] Fix | Delete
),
[978] Fix | Delete
[979] Fix | Delete
// BONK - audio - Bonk v0.9+
[980] Fix | Delete
'bonk' => array(
[981] Fix | Delete
'pattern' => '^\\x00(BONK|INFO|META| ID3)',
[982] Fix | Delete
'group' => 'audio',
[983] Fix | Delete
'module' => 'bonk',
[984] Fix | Delete
'mime_type' => 'audio/xmms-bonk',
[985] Fix | Delete
),
[986] Fix | Delete
[987] Fix | Delete
// DSF - audio - Direct Stream Digital (DSD) Storage Facility files (DSF) - https://en.wikipedia.org/wiki/Direct_Stream_Digital
[988] Fix | Delete
'dsf' => array(
[989] Fix | Delete
'pattern' => '^DSD ', // including trailing space: 44 53 44 20
[990] Fix | Delete
'group' => 'audio',
[991] Fix | Delete
'module' => 'dsf',
[992] Fix | Delete
'mime_type' => 'audio/dsd',
[993] Fix | Delete
),
[994] Fix | Delete
[995] Fix | Delete
// DSS - audio - Digital Speech Standard
[996] Fix | Delete
'dss' => array(
[997] Fix | Delete
'pattern' => '^[\\x02-\\x08]ds[s2]',
[998] Fix | Delete
'group' => 'audio',
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function