Update the include handling.

This commit is contained in:
FusionPBX 2022-10-11 11:54:01 -06:00 committed by GitHub
parent b300961d75
commit b8e8c726be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 13 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) 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')) {