tidy
This commit is contained in:
parent
77fc510bb3
commit
394e57103c
3 changed files with 3 additions and 14 deletions
|
@ -57,10 +57,6 @@ class FlashFileHandler extends DataHandlerExtension
|
||||||
$fp = fopen($tmpname, "r");
|
$fp = fopen($tmpname, "r");
|
||||||
$head = fread($fp, 3);
|
$head = fread($fp, 3);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
if (!in_array($head, ["CWS", "FWS"])) {
|
return in_array($head, ["CWS", "FWS"]);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,6 @@ class MP3FileHandler extends DataHandlerExtension
|
||||||
|
|
||||||
protected function check_contents(string $tmpname): bool
|
protected function check_contents(string $tmpname): bool
|
||||||
{
|
{
|
||||||
$mimeType = getMimeType($tmpname);
|
return getMimeType($tmpname) == 'audio/mpeg';
|
||||||
return ($mimeType == 'audio/mpeg');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,13 +64,7 @@ class PixelFileHandler extends DataHandlerExtension
|
||||||
{
|
{
|
||||||
$valid = [IMAGETYPE_PNG, IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_WEBP];
|
$valid = [IMAGETYPE_PNG, IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_WEBP];
|
||||||
$info = getimagesize($tmpname);
|
$info = getimagesize($tmpname);
|
||||||
if (!$info) {
|
return $info && in_array($info[2], $valid);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (in_array($info[2], $valid)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function create_thumb(string $hash, string $type): bool
|
protected function create_thumb(string $hash, string $type): bool
|
||||||
|
|
Reference in a new issue