Added magic numbers support.

This commit is contained in:
Darko
2014-12-10 09:51:00 +01:00
parent facada6b2e
commit 02ddadf957
7 changed files with 68 additions and 23 deletions
+5 -11
View File
@@ -1212,23 +1212,17 @@ Class ProcessAdditional
) {
$this->_processVideoFile($file);
} // Check if it's alt.binaries.u4e file.
else if (in_array($this->_releaseGroupName, array('alt.binaries.u4e', 'alt.binaries.mom')) &&
else if (in_array($this->_releaseGroupName, ['alt.binaries.u4e', 'alt.binaries.mom']) &&
preg_match('/Linux_2rename\.sh/i', $file) &&
($this->_release['categoryID'] == \Category::CAT_MISC_HASHED || $this->_release['categoryID'] == \Category::CAT_MISC_OTHER)
) {
$this->_processU4ETitle($file);
} // If we have GNU file, check the type of file and process it.
else if ($this->_hasGNUFile) {
exec('file -b "' . $file . '"', $output);
}
// Check file's magic info.
else {
$output = Utility::fileInfo($file);
if (!empty($output)) {
if (count($output) > 1) {
$output = implode(',', $output);
} else {
$output = $output[0];
}
switch (true) {
case ($this->_foundJPGSample === false && preg_match('/^JPE?G/i', $output[0])):