From c11920c9321766a720e4edd3d45850bab522fa80 Mon Sep 17 00:00:00 2001 From: frytimo Date: Sun, 16 Nov 2025 00:29:51 -0400 Subject: [PATCH] Fix PHP errors when trying to save with missing field data (#7620) --- app/bridges/bridge_edit.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/bridges/bridge_edit.php b/app/bridges/bridge_edit.php index add4093d10..800e321a48 100644 --- a/app/bridges/bridge_edit.php +++ b/app/bridges/bridge_edit.php @@ -54,16 +54,16 @@ //get http post variables and set them to php variables if (!empty($_POST)) { - $bridge_uuid = $_POST["bridge_uuid"]; - $bridge_name = $_POST["bridge_name"]; - $bridge_action = $_POST["bridge_action"]; - $bridge_profile = $_POST["bridge_profile"]; - $bridge_variables = $_POST["bridge_variables"]; - $bridge_gateways = $_POST["bridge_gateways"]; - $destination_number = $_POST["destination_number"]; - $bridge_destination = $_POST["bridge_destination"]; - $bridge_enabled = $_POST["bridge_enabled"]; - $bridge_description = $_POST["bridge_description"]; + $bridge_uuid = $_POST["bridge_uuid"] ?? null; + $bridge_name = $_POST["bridge_name"] ?? null; + $bridge_action = $_POST["bridge_action"] ?? null; + $bridge_profile = $_POST["bridge_profile"] ?? null; + $bridge_variables = $_POST["bridge_variables"] ?? null; + $bridge_gateways = $_POST["bridge_gateways"] ?? null; + $destination_number = $_POST["destination_number"] ?? null; + $bridge_destination = $_POST["bridge_destination"] ?? null; + $bridge_enabled = $_POST["bridge_enabled"] ?? null; + $bridge_description = $_POST["bridge_description"] ?? null; } //process the user data and save it to the database @@ -314,7 +314,7 @@ } //get the gateways - $actions = explode(',', $bridge_destination); + $actions = explode(',', $bridge_destination ?? ''); foreach ($actions as $action) { $action_array = explode('/',$action); if (!empty($action_array) && is_array($action_array) && !empty($action_array[1]) && $action_array[1] == 'gateway') {