We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26e265e commit ef5c451Copy full SHA for ef5c451
server/lib/classes/cron.d/500-backup_mail.inc.php
@@ -203,9 +203,14 @@ public function onRunJob() {
203
$dir_handle = opendir($mail_backup_dir.'/');
204
while ($file = readdir($dir_handle)) {
205
if(!is_dir($file)) {
206
- unlink ("$mail_backup_dir/"."$file");
+ if(substr($file,0,strlen($mail_backup_file)) == $mail_backup_file) {
207
+ unlink ($mail_backup_dir.'/'.$file);
208
+ }
209
}
210
211
+ if(count(glob($mail_backup_dir."/*", GLOB_NOSORT)) === 0) {
212
+ rmdir($mail_backup_dir);
213
214
215
/* remove backups from db */
216
$sql = "DELETE FROM mail_backup WHERE server_id = ? AND parent_domain_id = ? AND mailuser_id = ?";
0 commit comments