From 35a52b46c31a958c7b412235c72b51be63896016 Mon Sep 17 00:00:00 2001 From: fusionate Date: Tue, 6 Jun 2023 21:52:55 +0000 Subject: [PATCH] Email Templates: Updates for PHP 8.1 --- app/email_templates/email_template_edit.php | 6 +++--- app/email_templates/email_templates.php | 4 ++-- app/email_templates/resources/classes/email_templates.php | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/email_templates/email_template_edit.php b/app/email_templates/email_template_edit.php index d698f73109..f60482032e 100644 --- a/app/email_templates/email_template_edit.php +++ b/app/email_templates/email_template_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2018 + Portions created by the Initial Developer are Copyright (C) 2018-2023 the Initial Developer. All Rights Reserved. */ @@ -70,7 +70,7 @@ $template_subject = $_POST["template_subject"]; $template_body = $_POST["template_body"]; $template_type = $_POST["template_type"]; - $template_enabled = $_POST["template_enabled"] ?: 'false'; + $template_enabled = $_POST["template_enabled"] ?? 'false'; $template_description = $_POST["template_description"]; } @@ -115,7 +115,7 @@ } //add the email_template_uuid - if (!is_uuid($_POST["email_template_uuid"])) { + if (empty($_POST["email_template_uuid"]) || !is_uuid($_POST["email_template_uuid"])) { $email_template_uuid = uuid(); } diff --git a/app/email_templates/email_templates.php b/app/email_templates/email_templates.php index 0a479f60c9..84902db335 100644 --- a/app/email_templates/email_templates.php +++ b/app/email_templates/email_templates.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2016-2018 + Portions created by the Initial Developer are Copyright (C) 2016-2023 the Initial Developer. All Rights Reserved. */ @@ -49,7 +49,7 @@ //get posted data if (!empty($_POST['email_templates'])) { $action = $_POST['action']; - $category = $_POST['category']; + $category = $_POST['category'] ?? null; $search = $_POST['search']; $email_templates = $_POST['email_templates']; } diff --git a/app/email_templates/resources/classes/email_templates.php b/app/email_templates/resources/classes/email_templates.php index 9d6094a19e..027e76ee03 100644 --- a/app/email_templates/resources/classes/email_templates.php +++ b/app/email_templates/resources/classes/email_templates.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2019 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -80,7 +80,7 @@ if (!class_exists('email_templates')) { //build the delete array foreach ($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid']; } } @@ -126,7 +126,7 @@ if (!class_exists('email_templates')) { //get current toggle state foreach($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = "'".$record['uuid']."'"; } } @@ -195,7 +195,7 @@ if (!class_exists('email_templates')) { //get checked records foreach($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = "'".$record['uuid']."'"; } }