Email Templates: Updates for PHP 8.1

This commit is contained in:
fusionate 2023-06-06 21:52:55 +00:00
parent 9a7311b825
commit 35a52b46c3
No known key found for this signature in database
3 changed files with 9 additions and 9 deletions

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
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();
}

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
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'];
}

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
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']."'";
}
}