From d5f94819d0c0cfe36083923bf86b938757c44961 Mon Sep 17 00:00:00 2001 From: wrongecho Date: Wed, 18 Jun 2025 14:11:18 +0100 Subject: [PATCH 1/3] Fix 'Passing null to parameter' debug message --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 7c74dea4..7bbdbff6 100644 --- a/functions.php +++ b/functions.php @@ -199,7 +199,7 @@ function truncate($text, $chars) { function formatPhoneNumber($phoneNumber, $country_code = '', $show_country_code = false) { // Remove all non-digit characters - $digits = preg_replace('/\D/', '', $phoneNumber); + $digits = preg_replace('/\D/', '', $phoneNumber ?? ''); $formatted = ''; // If no digits at all, fallback early From 43ec144bf0b97b0c35e1a62449283e7fa472d70b Mon Sep 17 00:00:00 2001 From: wrongecho Date: Wed, 18 Jun 2025 14:47:21 +0100 Subject: [PATCH 2/3] Fix more debug errors --- functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 7bbdbff6..b8cd56b4 100644 --- a/functions.php +++ b/functions.php @@ -1659,7 +1659,7 @@ function display_folder_options($parent_folder_id, $client_id, $folder_location function sanitize_url($url) { $allowed = ['http', 'https', 'file', 'ftp', 'ftps', 'sftp', 'dav', 'webdav', 'caldav', 'carddav', 'ssh', 'telnet', 'smb', 'rdp', 'vnc', 'rustdesk', 'anydesk', 'connectwise', 'splashtop', 'sip', 'sips', 'ldap', 'ldaps']; - $parts = parse_url($url); + $parts = parse_url($url ?? ''); if (isset($parts['scheme']) && !in_array(strtolower($parts['scheme']), $allowed)) { // Remove the scheme and colon $pos = strpos($url, ':'); @@ -1673,5 +1673,5 @@ function sanitize_url($url) { } // Safe schemes: return escaped original URL - return htmlspecialchars($url, ENT_QUOTES, 'UTF-8'); + return htmlspecialchars($url ?? '', ENT_QUOTES, 'UTF-8'); } \ No newline at end of file From 3b3e323ce5f144e3321b6881bf49f443e8cec957 Mon Sep 17 00:00:00 2001 From: wrongecho Date: Wed, 18 Jun 2025 14:48:13 +0100 Subject: [PATCH 3/3] Assets - Import CSV now takes purchase date too (MUST be in format YYYY-MM-DD, Excel is annoying and will silently reformat this at random) --- modals/asset_import_modal.php | 3 ++- post/user/asset.php | 49 ++++++++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/modals/asset_import_modal.php b/modals/asset_import_modal.php index 25dc0deb..d5aa4f51 100644 --- a/modals/asset_import_modal.php +++ b/modals/asset_import_modal.php @@ -14,13 +14,14 @@