Prevent an error message if the directory doesn't exist.

This commit is contained in:
FusionPBX 2022-09-12 11:41:03 -06:00 committed by GitHub
parent be257eeb03
commit 5ed64d2be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -809,10 +809,12 @@ if (!class_exists('modules')) {
$xml .= " </modules>\n";
$xml .= "</configuration>";
$fout = fopen($_SESSION['switch']['conf']['dir']."/autoload_configs/modules.conf.xml","w");
fwrite($fout, $xml);
unset($xml);
fclose($fout);
if (file_exists($_SESSION['switch']['conf']['dir'].'/autoload_configs')) {
$fout = fopen($_SESSION['switch']['conf']['dir']."/autoload_configs/modules.conf.xml","w");
fwrite($fout, $xml);
unset($xml);
fclose($fout);
}
//apply settings
$_SESSION["reload_xml"] = true;