This commit is contained in:
Shish 2020-02-23 18:14:15 +00:00
parent 77fc510bb3
commit 394e57103c
3 changed files with 3 additions and 14 deletions

View file

@ -57,10 +57,6 @@ class FlashFileHandler extends DataHandlerExtension
$fp = fopen($tmpname, "r");
$head = fread($fp, 3);
fclose($fp);
if (!in_array($head, ["CWS", "FWS"])) {
return false;
}
return true;
return in_array($head, ["CWS", "FWS"]);
}
}

View file

@ -51,7 +51,6 @@ class MP3FileHandler extends DataHandlerExtension
protected function check_contents(string $tmpname): bool
{
$mimeType = getMimeType($tmpname);
return ($mimeType == 'audio/mpeg');
return getMimeType($tmpname) == 'audio/mpeg';
}
}

View file

@ -64,13 +64,7 @@ class PixelFileHandler extends DataHandlerExtension
{
$valid = [IMAGETYPE_PNG, IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_WEBP];
$info = getimagesize($tmpname);
if (!$info) {
return false;
}
if (in_array($info[2], $valid)) {
return true;
}
return false;
return $info && in_array($info[2], $valid);
}
protected function create_thumb(string $hash, string $type): bool