Check to make sure directory does not exist before using mkdir.

This commit is contained in:
markjcrane 2016-04-28 21:22:48 -06:00
parent cddc2e9df6
commit 46dafa9660
1 changed files with 3 additions and 1 deletions

View File

@ -88,7 +88,9 @@ if ($domains_processed == 1) {
$voicemails = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($voicemails as $row) {
$path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$row['domain_name'].'/'.$row['voicemail_id'];
mkdir($path, 0777, true);
if (!file_exists($path)) {
mkdir($path, 0777, true);
}
}
unset ($prep_statement, $sql);