Check for directory before trying to create (#3627)

This commit is contained in:
Killsudo 2018-10-04 21:30:31 -05:00 committed by FusionPBX
parent cb953f5093
commit f81d96c44b
1 changed files with 3 additions and 1 deletions

View File

@ -1419,7 +1419,9 @@ include "root.php";
$file_contents = $this->render();
//write the file
mkdir($directory,0777,true);
if(!is_dir($directory)) {
mkdir($directory,0777,true);
}
$fh = fopen($dest_path,"w") or die("Unable to write to $directory for provisioning. Make sure the path exists and permissons are set correctly.");
fwrite($fh, $file_contents);
fclose($fh);