From f40621141f31dc40581f155302df744cb1e3e1d2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 22 Oct 2022 23:56:10 -0600 Subject: [PATCH] Update the include path --- secure/v_mailto.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/secure/v_mailto.php b/secure/v_mailto.php index f2491bb906..f727a6e807 100644 --- a/secure/v_mailto.php +++ b/secure/v_mailto.php @@ -26,16 +26,15 @@ */ //set the include path - if (defined('STDIN')) { - $document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]); - preg_match("/^(.*)\/secure\/.*$/", $document_root, $matches); - $document_root = $matches[1]; - set_include_path($document_root); - $_SERVER["DOCUMENT_ROOT"] = $document_root; + if (defined('STDIN')) { + $conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE); + set_include_path(parse_ini_file($conf[0])['document.root']); + } + else { + exit; } -//includes - if (!defined('STDIN')) { include_once "root.php"; } +//include files require_once "resources/require.php"; //define a function to remove html tags