diff --git a/admin/ai_model.php b/admin/ai_model.php index 2eab6bda..1f76e8ea 100644 --- a/admin/ai_model.php +++ b/admin/ai_model.php @@ -60,11 +60,11 @@ $num_rows = mysqli_num_rows($sql); while ($row = mysqli_fetch_assoc($sql)) { $provider_id = intval($row['ai_provider_id']); - $provider_name = nullable_htmlentities($row['ai_provider_name']); + $provider_name = escapeHtml($row['ai_provider_name']); $model_id = intval($row['ai_model_id']); - $model_name = nullable_htmlentities($row['ai_model_name']); - $use_case = nullable_htmlentities($row['ai_model_use_case']); - $prompt = nl2br(nullable_htmlentities($row['ai_model_prompt'])); + $model_name = escapeHtml($row['ai_model_name']); + $use_case = escapeHtml($row['ai_model_use_case']); + $prompt = nl2br(escapeHtml($row['ai_model_prompt'])); ?> diff --git a/admin/ai_provider.php b/admin/ai_provider.php index 1f8eb398..69001c85 100644 --- a/admin/ai_provider.php +++ b/admin/ai_provider.php @@ -50,9 +50,9 @@ $num_rows = mysqli_num_rows($sql); while ($row = mysqli_fetch_assoc($sql)) { $provider_id = intval($row['ai_provider_id']); - $provider_name = nullable_htmlentities($row['ai_provider_name']); - $url = nullable_htmlentities($row['ai_provider_api_url']); - $key = nullable_htmlentities($row['ai_provider_api_key']); + $provider_name = escapeHtml($row['ai_provider_name']); + $url = escapeHtml($row['ai_provider_api_url']); + $key = escapeHtml($row['ai_provider_api_key']); $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ai_model_id') AS ai_model_count FROM ai_models WHERE ai_model_ai_provider_id = $provider_id")); $ai_model_count = intval($row['ai_model_count']); diff --git a/admin/api_keys.php b/admin/api_keys.php index eb21404c..387ae257 100644 --- a/admin/api_keys.php +++ b/admin/api_keys.php @@ -33,7 +33,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -107,10 +107,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); while ($row = mysqli_fetch_assoc($sql)) { $api_key_id = intval($row['api_key_id']); - $api_key_name = nullable_htmlentities($row['api_key_name']); - $api_key_secret = nullable_htmlentities("************" . substr($row['api_key_secret'], -4)); - $api_key_created_at = nullable_htmlentities($row['api_key_created_at']); - $api_key_expire = nullable_htmlentities($row['api_key_expire']); + $api_key_name = escapeHtml($row['api_key_name']); + $api_key_secret = escapeHtml("************" . substr($row['api_key_secret'], -4)); + $api_key_created_at = escapeHtml($row['api_key_created_at']); + $api_key_expire = escapeHtml($row['api_key_expire']); if ($api_key_expire < date("Y-m-d H:i:s")) { $api_key_expire = $api_key_expire . " (Expired)"; } @@ -118,7 +118,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); if ($row['api_key_client_id'] == 0) { $api_key_client = "All Clients"; } else { - $api_key_client = nullable_htmlentities($row['client_name']); + $api_key_client = escapeHtml($row['client_name']); } ?> diff --git a/admin/app_log.php b/admin/app_log.php index a50c6d5b..350a9d72 100644 --- a/admin/app_log.php +++ b/admin/app_log.php @@ -9,7 +9,7 @@ require_once "includes/inc_all_admin.php"; // Log Type Filter if (isset($_GET['type']) & !empty($_GET['type'])) { $log_type_query = "AND (app_log_type = '" . sanitizeInput($_GET['type']) . "')"; - $type_filter = nullable_htmlentities($_GET['type']); + $type_filter = escapeHtml($_GET['type']); } else { // Default - any $log_type_query = ''; @@ -19,7 +19,7 @@ if (isset($_GET['type']) & !empty($_GET['type'])) { // Log Category Filter if (isset($_GET['category']) & !empty($_GET['catergory'])) { $log_category_query = "AND (app_log_category = '" . sanitizeInput($_GET['category']) . "')"; - $category_filter = nullable_htmlentities($_GET['category']); + $category_filter = escapeHtml($_GET['category']); } else { // Default - any $log_category_query = ''; @@ -50,7 +50,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -67,7 +67,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - - - + + +
@@ -143,10 +143,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); while ($row = mysqli_fetch_assoc($sql)) { $log_id = intval($row['app_log_id']); - $log_type = nullable_htmlentities($row['app_log_type']); - $log_category = nullable_htmlentities($row['app_log_category']); - $log_details = nullable_htmlentities($row['app_log_details']); - $log_created_at = nullable_htmlentities($row['app_log_created_at']); + $log_type = escapeHtml($row['app_log_type']); + $log_category = escapeHtml($row['app_log_category']); + $log_details = escapeHtml($row['app_log_details']); + $log_created_at = escapeHtml($row['app_log_created_at']); ?> diff --git a/admin/audit_log.php b/admin/audit_log.php index 0cb9a32a..cbac2849 100644 --- a/admin/audit_log.php +++ b/admin/audit_log.php @@ -29,7 +29,7 @@ if (isset($_GET['client']) & !empty($_GET['client'])) { // Log Type Filter if (isset($_GET['type']) & !empty($_GET['type'])) { $log_type_query = "AND (log_type = '" . sanitizeInput($_GET['type']) . "')"; - $type_filter = nullable_htmlentities($_GET['type']); + $type_filter = escapeHtml($_GET['type']); } else { // Default - any $log_type_query = ''; @@ -39,7 +39,7 @@ if (isset($_GET['type']) & !empty($_GET['type'])) { // Log Action Filter if (isset($_GET['action']) & !empty($_GET['action'])) { $log_action_query = "AND (log_action = '" . sanitizeInput($_GET['action']) . "')"; - $action_filter = nullable_htmlentities($_GET['action']); + $action_filter = escapeHtml($_GET['action']); } else { // Default - any $log_action_query = ''; @@ -73,7 +73,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -90,7 +90,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $sql_clients_filter = mysqli_query($mysqli, "SELECT * FROM clients ORDER BY client_name ASC"); while ($row = mysqli_fetch_assoc($sql_clients_filter)) { $client_id = intval($row['client_id']); - $client_name = nullable_htmlentities($row['client_name']); + $client_name = escapeHtml($row['client_name']); ?> - - - + + +
@@ -227,22 +227,22 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); while ($row = mysqli_fetch_assoc($sql)) { $log_id = intval($row['log_id']); - $log_type = nullable_htmlentities($row['log_type']); - $log_action = nullable_htmlentities($row['log_action']); - $log_description = nullable_htmlentities($row['log_description']); - $log_ip = nullable_htmlentities($row['log_ip']); - $log_user_agent = nullable_htmlentities($row['log_user_agent']); + $log_type = escapeHtml($row['log_type']); + $log_action = escapeHtml($row['log_action']); + $log_description = escapeHtml($row['log_description']); + $log_ip = escapeHtml($row['log_ip']); + $log_user_agent = escapeHtml($row['log_user_agent']); $log_user_os = getOS($log_user_agent); $log_user_browser = getWebBrowser($log_user_agent); - $log_created_at = nullable_htmlentities($row['log_created_at']); + $log_created_at = escapeHtml($row['log_created_at']); $user_id = intval($row['user_id']); - $user_name = nullable_htmlentities($row['user_name']); + $user_name = escapeHtml($row['user_name']); if (empty($user_name)) { $user_name_display = "-"; } else { $user_name_display = $user_name; } - $client_name = nullable_htmlentities($row['client_name']); + $client_name = escapeHtml($row['client_name']); $client_id = intval($row['client_id']); if (empty($client_name)) { $client_name_display = "-"; diff --git a/admin/category.php b/admin/category.php index 16bca100..9e692808 100644 --- a/admin/category.php +++ b/admin/category.php @@ -28,14 +28,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));

- Categories + Categories

- +
- +
+ placeholder="Search Categories ">
@@ -143,9 +143,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); while ($row = mysqli_fetch_assoc($sql)) { $category_id = intval($row['category_id']); - $category_name = nullable_htmlentities($row['category_name']); - $category_description = nullable_htmlentities($row['category_description']); - $category_color = nullable_htmlentities($row['category_color']); + $category_name = escapeHtml($row['category_name']); + $category_description = escapeHtml($row['category_description']); + $category_color = escapeHtml($row['category_color']); ?> diff --git a/admin/contract_template.php b/admin/contract_template.php index f8098658..c1aa5dc1 100644 --- a/admin/contract_template.php +++ b/admin/contract_template.php @@ -31,7 +31,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -61,28 +61,28 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); -
+
diff --git a/admin/custom_link.php b/admin/custom_link.php index 08eefb79..0d930489 100644 --- a/admin/custom_link.php +++ b/admin/custom_link.php @@ -30,7 +30,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -74,9 +74,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); while ($row = mysqli_fetch_assoc($sql)) { $custom_link_id = intval($row['custom_link_id']); - $custom_link_name = nullable_htmlentities($row['custom_link_name']); - $custom_link_uri = nullable_htmlentities($row['custom_link_uri']); - $custom_link_icon = nullable_htmlentities($row['custom_link_icon']); + $custom_link_name = escapeHtml($row['custom_link_name']); + $custom_link_uri = escapeHtml($row['custom_link_uri']); + $custom_link_icon = escapeHtml($row['custom_link_icon']); $custom_link_new_tab = intval($row['custom_link_new_tab']); if ($custom_link_new_tab == 1 ) { $custom_link_new_tab_display = ""; diff --git a/admin/document_template.php b/admin/document_template.php index 5b2d808a..131ac3c9 100644 --- a/admin/document_template.php +++ b/admin/document_template.php @@ -31,7 +31,7 @@
- +
@@ -68,12 +68,12 @@ while ($row = mysqli_fetch_assoc($sql)) { $document_template_id = intval($row['document_template_id']); - $document_template_name = nullable_htmlentities($row['document_template_name']); - $document_template_description = nullable_htmlentities($row['document_template_description']); - $document_template_content = nullable_htmlentities($row['document_template_content']); - $document_template_created_by_name = nullable_htmlentities($row['user_name']); - $document_template_created_at = nullable_htmlentities($row['document_template_created_at']); - $document_template_updated_at = nullable_htmlentities(getFallback($row['document_template_updated_at'])); + $document_template_name = escapeHtml($row['document_template_name']); + $document_template_description = escapeHtml($row['document_template_description']); + $document_template_content = escapeHtml($row['document_template_content']); + $document_template_created_by_name = escapeHtml($row['user_name']); + $document_template_created_at = escapeHtml($row['document_template_created_at']); + $document_template_updated_at = escapeHtml(getFallback($row['document_template_updated_at'])); ?> diff --git a/admin/document_template_details.php b/admin/document_template_details.php index fa6c3f51..6e8503eb 100644 --- a/admin/document_template_details.php +++ b/admin/document_template_details.php @@ -25,11 +25,11 @@ if (mysqli_num_rows($sql_document) == 0) { $row = mysqli_fetch_assoc($sql_document); -$document_template_name = nullable_htmlentities($row['document_template_name']); -$document_template_description = nullable_htmlentities($row['document_template_description']); +$document_template_name = escapeHtml($row['document_template_name']); +$document_template_description = escapeHtml($row['document_template_description']); $document_template_content = $purifier->purify($row['document_template_content']); -$document_template_created_at = nullable_htmlentities($row['document_template_created_at']); -$document_template_updated_at = nullable_htmlentities($row['document_template_updated_at']); +$document_template_created_at = escapeHtml($row['document_template_created_at']); +$document_template_updated_at = escapeHtml($row['document_template_updated_at']); ?> diff --git a/admin/identity_provider.php b/admin/identity_provider.php index 6a39905e..d3f03114 100644 --- a/admin/identity_provider.php +++ b/admin/identity_provider.php @@ -33,7 +33,7 @@ require_once "includes/inc_all_admin.php";
- +
@@ -43,7 +43,7 @@ require_once "includes/inc_all_admin.php";
- +
diff --git a/admin/includes/side_nav.php b/admin/includes/side_nav.php index 5d7b224a..07b82578 100644 --- a/admin/includes/side_nav.php +++ b/admin/includes/side_nav.php @@ -1,5 +1,5 @@ -