commit 6c6cee040d01221f07a5574227f4b1170bab7b5d
parent 37fa38bf4b4ed4303a088996e232758e1b0be44b
Author: Nixx <nixx@firemail.cc>
Date: Thu, 17 Feb 2022 12:02:49 +0000
Check for empty
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/index.php b/index.php
@@ -22,7 +22,7 @@ $maxsize = 12 * 1024 * 1024; // 12 MB
$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$url = $protocol.$_SERVER['HTTP_HOST'];
-if($_FILES){
+if(($tmpfile = $_FILES['upload']['tmp_name'])){
if($_FILES['upload']['size'] > $maxsize){
exit("ERR: Filesize too large.\n");
}
@@ -37,9 +37,7 @@ if($_FILES){
$name = $name.".".$ext;
}
- $tmpfile = $_FILES['upload']['tmp_name'];
$isimage = getimagesize($tmpfile) ? true : false;
-
if($isimage){
$img = new Imagick(realpath($tmpfile));
$profile = $img->getImageProfiles("icc", true);