From e54eae13a71f5d75e34a7bb51b453f422e1c846f Mon Sep 17 00:00:00 2001 From: Joe Clark Date: Tue, 22 Mar 2022 13:06:14 -0700 Subject: [PATCH 1/3] Fix bug with initializing variable name --- clients.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients.php b/clients.php index c54b32e6..5de1d043 100644 --- a/clients.php +++ b/clients.php @@ -23,7 +23,7 @@ if(isset($_GET['query'])){ } }else{ $query = ""; - $number_query = ""; + $phone_query = ""; } //Column Filter From 9a04ff5341c63ca24c4341cd6a5cb6c1ea26a1ec Mon Sep 17 00:00:00 2001 From: Joe Clark Date: Tue, 22 Mar 2022 13:06:39 -0700 Subject: [PATCH 2/3] Check if path exists before attempting to remove --- functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index f2269a64..b14b4f0b 100644 --- a/functions.php +++ b/functions.php @@ -39,6 +39,10 @@ function initials($str) { } function removeDirectory($path) { + if (!file_exists($path)) { + return; + } + $files = glob($path . '/*'); foreach ($files as $file) { is_dir($file) ? removeDirectory($file) : unlink($file); @@ -396,4 +400,4 @@ function encryptUpgradeLoginEntry($login_password_cleartext, $site_encryption_ma return $login_password_ciphertext; } -?> \ No newline at end of file +?> From 654b7adf6cebe69f5ed2282c0bed0e2cc5f4a045 Mon Sep 17 00:00:00 2001 From: Joe Clark Date: Tue, 22 Mar 2022 13:07:11 -0700 Subject: [PATCH 3/3] Initialize variable to avoid PHP undefined error --- post.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 94bc1b01..771fa567 100644 --- a/post.php +++ b/post.php @@ -133,6 +133,7 @@ if(isset($_POST['edit_user'])){ $default_company = intval($_POST['default_company']); $role = intval($_POST['role']); $existing_file_name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['existing_file_name']))); + $extended_log_description = ''; if(!file_exists("uploads/users/$user_id/")) { mkdir("uploads/users/$user_id"); @@ -216,6 +217,7 @@ if(isset($_POST['edit_profile'])){ $new_password = trim($_POST['new_password']); $existing_file_name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['existing_file_name']))); $logout = FALSE; + $extended_log_description = ''; //Check to see if a file is attached if($_FILES['file']['tmp_name'] != ''){ @@ -1137,6 +1139,7 @@ if(isset($_POST['add_client'])){ $currency_code = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['currency_code']))); $net_terms = intval($_POST['net_terms']); $notes = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']))); + $extended_log_description = ''; mysqli_query($mysqli,"INSERT INTO clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_currency_code = '$currency_code', client_net_terms = $net_terms, client_notes = '$notes', client_created_at = NOW(), client_accessed_at = NOW(), company_id = $session_company_id"); @@ -8005,4 +8008,4 @@ if(isset($_GET['logout'])){ header('Location: login.php'); } -?> \ No newline at end of file +?>