diff --git a/app/dialplans/dialplan_xml.php b/app/dialplans/dialplan_xml.php index 8d11645264..4d38ea4e98 100644 --- a/app/dialplans/dialplan_xml.php +++ b/app/dialplans/dialplan_xml.php @@ -43,13 +43,13 @@ } //get the uuids - if (is_uuid($_REQUEST['id'])) { + if (!empty($_REQUEST['id']) && is_uuid($_REQUEST['id'])) { $dialplan_uuid = $_REQUEST['id']; } - if (is_uuid($_REQUEST['app_uuid'])) { + if (!empty($_REQUEST['app_uuid']) && is_uuid($_REQUEST['app_uuid'])) { $app_uuid = $_REQUEST['app_uuid']; } - $dialplan_xml = $_REQUEST['dialplan_xml']; + $dialplan_xml = $_REQUEST['dialplan_xml'] ?? ''; //process the HTTP POST if (count($_POST) > 0 && empty($_POST["persistformvar"])) { @@ -110,7 +110,7 @@ } //disable xml entities and load the xml object to test if the xml is valid - libxml_disable_entity_loader(true); + if (PHP_VERSION_ID < 80000) { libxml_disable_entity_loader(true); } preg_match_all('/^\s*(?:[\S\s])+<\/extension>\s*$/mU', $dialplan_xml, $matches); foreach($matches as $match) { $xml = simplexml_load_string($match[0], 'SimpleXMLElement', LIBXML_NOCDATA); @@ -183,11 +183,11 @@ $text = $language->get(); // load editor preferences/defaults - $setting_size = $_SESSION["editor"]["font_size"]["text"] != '' ? $_SESSION["editor"]["font_size"]["text"] : '12px'; - $setting_theme = $_SESSION["editor"]["theme"]["text"] != '' ? $_SESSION["editor"]["theme"]["text"] : 'cobalt'; - $setting_invisibles = $_SESSION["editor"]["invisibles"]["boolean"] != '' ? $_SESSION["editor"]["invisibles"]["boolean"] : 'false'; - $setting_indenting = $_SESSION["editor"]["indent_guides"]["boolean"] != '' ? $_SESSION["editor"]["indent_guides"]["boolean"] : 'false'; - $setting_numbering = $_SESSION["editor"]["line_numbers"]["boolean"] != '' ? $_SESSION["editor"]["line_numbers"]["boolean"] : 'true'; + $setting_size = !empty($_SESSION["editor"]["font_size"]["text"]) ? $_SESSION["editor"]["font_size"]["text"] : '12px'; + $setting_theme = !empty($_SESSION["editor"]["theme"]["text"]) ? $_SESSION["editor"]["theme"]["text"] : 'cobalt'; + $setting_invisibles = isset($_SESSION["editor"]["invisibles"]["boolean"]) && $_SESSION["editor"]["invisibles"]["boolean"] != '' ? $_SESSION["editor"]["invisibles"]["boolean"] : 'false'; + $setting_indenting = isset($_SESSION["editor"]["indent_guides"]["boolean"]) && $_SESSION["editor"]["indent_guides"]["boolean"] != '' ? $_SESSION["editor"]["indent_guides"]["boolean"] : 'false'; + $setting_numbering = isset($_SESSION["editor"]["line_numbers"]["boolean"]) && $_SESSION["editor"]["line_numbers"]["boolean"] != '' ? $_SESSION["editor"]["line_numbers"]["boolean"] : 'true'; //create token $object = new token; @@ -267,7 +267,7 @@ echo "
\n"; echo "
".$text['title-dialplan_edit']." XML
\n"; echo "
\n"; - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','link'=>'dialplan_edit.php?id='.urlencode($dialplan_uuid).(is_uuid($app_uuid) ? "&app_uuid=".urlencode($app_uuid) : null)]); + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','link'=>'dialplan_edit.php?id='.urlencode($dialplan_uuid).(!empty($app_uuid) && is_uuid($app_uuid) ? "&app_uuid=".urlencode($app_uuid) : null)]); echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;','onclick'=>"set_value(); $('#frm').submit();"]); echo "
\n"; echo "
\n"; @@ -351,8 +351,8 @@ echo "
\n"; echo "
\n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; echo " \n"; echo "\n";