From b8e8c726be266fcb8e4ada87e9d8543b0eea62f5 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 11 Oct 2022 11:54:01 -0600 Subject: [PATCH] Update the include handling. --- app/xml_cdr/xml_cdr_import.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/app/xml_cdr/xml_cdr_import.php b/app/xml_cdr/xml_cdr_import.php index 5076ea08dc..fa5f83ee7d 100644 --- a/app/xml_cdr/xml_cdr_import.php +++ b/app/xml_cdr/xml_cdr_import.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-2021 + Portions created by the Initial Developer are Copyright (C) 2016-2022 the Initial Developer. All Rights Reserved. Contributor(s): @@ -26,22 +26,17 @@ //check the permission if(defined('STDIN')) { - $document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]); - preg_match("/^(.*)\/app\/.*$/", $document_root, $matches); - $document_root = $matches[1]; - set_include_path($document_root); - $_SERVER["DOCUMENT_ROOT"] = $document_root; - require_once "resources/require.php"; - } - else { //set the include path $conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE); set_include_path(parse_ini_file($conf[0])['document.root']); - - //includes files - require_once "resources/require.php"; - require_once "resources/pdo.php"; } + else { + exit; + } + +//includes files + require_once "resources/require.php"; + require_once "resources/pdo.php"; //check the domain cidr range if (isset($_SESSION['cdr']["cidr"]) && !defined('STDIN')) {