Update the include path

This commit is contained in:
FusionPBX 2022-10-22 23:56:10 -06:00 committed by GitHub
parent 720eb58a89
commit f40621141f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 8 deletions

View File

@ -26,16 +26,15 @@
*/ */
//set the include path //set the include path
if (defined('STDIN')) { if (defined('STDIN')) {
$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]); $conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
preg_match("/^(.*)\/secure\/.*$/", $document_root, $matches); set_include_path(parse_ini_file($conf[0])['document.root']);
$document_root = $matches[1]; }
set_include_path($document_root); else {
$_SERVER["DOCUMENT_ROOT"] = $document_root; exit;
} }
//includes //include files
if (!defined('STDIN')) { include_once "root.php"; }
require_once "resources/require.php"; require_once "resources/require.php";
//define a function to remove html tags //define a function to remove html tags