From 0c28221ae24c59b5b7b3c8aa0e68080fa4dfe546 Mon Sep 17 00:00:00 2001 From: Luis Daniel Lucio Quiroz Date: Mon, 24 Apr 2023 23:06:58 -0400 Subject: [PATCH] Fix adding Faxes (#6614) $fax_email_outbound_authorized_senders is only filled when fax_extension_advanced permission is set. However, the edit part doesn't verify that sizeof(NULL) creates a fatal error. Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/fusionpbx/app/fax/fax_edit.php:286 Stack trace: #0 {main} thrown in /var/www/fusionpbx/app/fax/fax_edit.php on line 286 This patch verifies that $fax_email_outbound_authorized_senders is an array before sizeof() evaluates it. You can now add faxes with the fax_extension_advanced disabled. --- app/fax/fax_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index 38c29e080d..bf6d379e2f 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -283,7 +283,7 @@ if ($_POST["persistformvar"] != "true") { //prep authorized senders - if (sizeof($fax_email_outbound_authorized_senders) > 0) { + if (is_array($fax_email_outbound_authorized_senders) && (sizeof($fax_email_outbound_authorized_senders) > 0)) { foreach ($fax_email_outbound_authorized_senders as $sender_num => $sender) { if ($sender == '' || (substr_count($sender, '@') == 1 && !valid_email($sender)) || substr_count($sender, '.') == 0) { unset($fax_email_outbound_authorized_senders[$sender_num]);