From d34bd3f22334d7bd761555b63f769a3edeb11534 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 15 Jan 2024 13:26:28 +0100 Subject: [PATCH] #12156 fix sql error check exists --- pandora_console/include/functions_notifications.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_notifications.php b/pandora_console/include/functions_notifications.php index 89027fbf81..e59208f8ef 100644 --- a/pandora_console/include/functions_notifications.php +++ b/pandora_console/include/functions_notifications.php @@ -676,14 +676,14 @@ function notifications_set_user_label_status($source, $user, $label, $value) return false; } - $eixsts = db_get_row('tnotification_source_user', 'id_user', $user); - if (empty($eixsts['enabled']) && empty($eixsts['also_mail'])) { + $exists = db_process_sql(sprintf('SELECT * FROM tnotification_source_user WHERE id_user = "%s" AND id_source = "%s"', $user, $source)); + if (empty($exists['enabled']) && empty($exists['also_mail'])) { $sql = sprintf('DELETE FROM tnotification_source_user WHERE id_user = "%s" AND id_source = "%s"', $user, $source); db_process_sql($sql); - $eixsts = false; + $exists = false; } - if ($eixsts === false) { + if ($exists === false) { db_process_sql_insert( 'tnotification_source_user', [