diff --git a/ext/handle_flash/main.php b/ext/handle_flash/main.php index 7520cfbf..5c188d99 100644 --- a/ext/handle_flash/main.php +++ b/ext/handle_flash/main.php @@ -54,10 +54,6 @@ class FlashFileHandler extends DataHandlerExtension protected function check_contents(string $tmpname): bool { - if (!file_exists($tmpname)) { - return false; - } - $fp = fopen($tmpname, "r"); $head = fread($fp, 3); fclose($fp); diff --git a/ext/handle_ico/main.php b/ext/handle_ico/main.php index 28599302..2bd68cac 100644 --- a/ext/handle_ico/main.php +++ b/ext/handle_ico/main.php @@ -48,9 +48,6 @@ class IcoFileHandler extends DataHandlerExtension protected function check_contents(string $file): bool { - if (!file_exists($file)) { - return false; - } $fp = fopen($file, "r"); $header = unpack("Snull/Stype/Scount", fread($fp, 6)); fclose($fp); diff --git a/ext/handle_mp3/main.php b/ext/handle_mp3/main.php index f36b05ca..a2ac2865 100644 --- a/ext/handle_mp3/main.php +++ b/ext/handle_mp3/main.php @@ -51,14 +51,7 @@ class MP3FileHandler extends DataHandlerExtension protected function check_contents(string $tmpname): bool { - $success = false; - - if (file_exists($tmpname)) { - $mimeType = getMimeType($tmpname); - - $success = ($mimeType == 'audio/mpeg'); - } - - return $success; + $mimeType = getMimeType($tmpname); + return ($mimeType == 'audio/mpeg'); } } diff --git a/ext/handle_pixel/main.php b/ext/handle_pixel/main.php index 79b42e12..70036b90 100644 --- a/ext/handle_pixel/main.php +++ b/ext/handle_pixel/main.php @@ -63,9 +63,6 @@ class PixelFileHandler extends DataHandlerExtension protected function check_contents(string $tmpname): bool { $valid = [IMAGETYPE_PNG, IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_WEBP]; - if (!file_exists($tmpname)) { - return false; - } $info = getimagesize($tmpname); if (!$info) { return false; diff --git a/ext/handle_svg/main.php b/ext/handle_svg/main.php index fc1c675d..93c0b5d1 100644 --- a/ext/handle_svg/main.php +++ b/ext/handle_svg/main.php @@ -98,10 +98,6 @@ class SVGFileHandler extends DataHandlerExtension protected function check_contents(string $file): bool { - if (!file_exists($file)) { - return false; - } - $msp = new MiniSVGParser($file); return bool_escape($msp->valid); } diff --git a/ext/handle_video/main.php b/ext/handle_video/main.php index e669a463..2cd792e5 100644 --- a/ext/handle_video/main.php +++ b/ext/handle_video/main.php @@ -126,9 +126,6 @@ class VideoFileHandler extends DataHandlerExtension protected function check_contents(string $tmpname): bool { - return ( - file_exists($tmpname) && - in_array(getMimeType($tmpname), self::SUPPORTED_MIME) - ); + return in_array(getMimeType($tmpname), self::SUPPORTED_MIME); } }