From fd4196bcac142b875a76ff6f6de99d942d5d879e Mon Sep 17 00:00:00 2001 From: root Date: Sat, 13 Apr 2019 23:32:00 -0400 Subject: [PATCH] Fix expense file uploads always showing even though nothing got uploaded --- post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post.php b/post.php index 6945a006..09018ee5 100644 --- a/post.php +++ b/post.php @@ -340,7 +340,7 @@ if(isset($_POST['add_expense'])){ $category = intval($_POST['category']); $description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description'])); - if(!empty($_FILES['file'])){ + if($_FILES['file']['tmp_name']!='') { $path = "uploads/expenses/$vendor/"; $path = $path . basename( $_FILES['file']['name']); $file_name = basename($path);