Skip to content

Commit c4be523

Browse files
author
Florian Schaal
committed
mailbackup: fixed domain-query
1 parent 21cdaaa commit c4be523

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server/lib/classes/cron.d/500-backup_mail.inc.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ public function onRunJob() {
8383
foreach($records as $rec) {
8484
//* Do the mailbox backup
8585
if($rec['backup_interval'] == 'daily' or ($rec['backup_interval'] == 'weekly' && date('w') == 0) or ($rec['backup_interval'] == 'monthly' && date('d') == '01')) {
86-
$email = $rec['email'][1];
87-
$sql="SELECT * FROM mail_domain WHERE domain = ?" . $app->db->quote(explode("@",$email))."'";
88-
unset($email);
86+
$email = $rec['email'];
87+
$email=explode("@",$email)[1];
88+
$sql="SELECT * FROM mail_domain WHERE domain = '" . $app->db->quote($email)."'";
8989
$domain_rec=$app->db->queryOneRecord($sql);
90+
unset($email);
9091

9192
$mail_backup_dir = $backup_dir.'/mail'.$domain_rec['domain_id'];
9293
if(!is_dir($mail_backup_dir)) mkdir($mail_backup_dir, 0750);

0 commit comments

Comments
 (0)