is_writable prevents an error writing to the file if its not writable

This commit is contained in:
FusionPBX 2023-07-16 00:44:18 -06:00 committed by GitHub
parent 5e69a3deda
commit f7b1ad53cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -799,7 +799,7 @@ if (!class_exists('modules')) {
$xml .= " </modules>\n";
$xml .= "</configuration>";
if (file_exists($_SESSION['switch']['conf']['dir'].'/autoload_configs')) {
if (is_writable($_SESSION['switch']['conf']['dir'].'/autoload_configs/modules.conf.xml')) {
$fout = fopen($_SESSION['switch']['conf']['dir']."/autoload_configs/modules.conf.xml","w");
fwrite($fout, $xml);
unset($xml);