fixed upload without image

This commit is contained in:
Jan Felix Wiebe 2019-02-23 13:55:24 +01:00 committed by /jedi/
parent f2aaadac79
commit c2aed76eda

View file

@ -182,7 +182,7 @@ switch($_GET["action"]) {
} }
$item_id = $mysqli->insert_id; $item_id = $mysqli->insert_id;
if(isset($_FILES["image"])){ if(isset($_FILES["image"]) && hasval($_FILES["image"]["tmp_name"])){
$hash = md5($_FILES['image']['name'].time()); $hash = md5($_FILES['image']['name'].time());
if(move_uploaded_file($_FILES['image']['tmp_name'], "upload/".$hash)){ if(move_uploaded_file($_FILES['image']['tmp_name'], "upload/".$hash)){