From d658f3f6fabed23bf24f030d74c589cf8b889ead Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Wed, 10 Dec 2014 14:27:15 +0530 Subject: [PATCH] MDL-48556 backup: Use correct conditions before checking dir permissions --- backup/util/helper/backup_cron_helper.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup/util/helper/backup_cron_helper.class.php b/backup/util/helper/backup_cron_helper.class.php index 5adb9738beb..671a8b51501 100644 --- a/backup/util/helper/backup_cron_helper.class.php +++ b/backup/util/helper/backup_cron_helper.class.php @@ -403,7 +403,7 @@ abstract class backup_cron_automated_helper { $bc->log('No directory specified for automated backups', backup::LOG_WARNING); $outcome = self::BACKUP_STATUS_WARNING; - } else if (!file_exists($dir) || !is_dir($dir) || !is_writable($dir) && $storage !== 0) { + } else if ($storage !== 0 && (!file_exists($dir) || !is_dir($dir) || !is_writable($dir))) { // If we need to copy the backup file to an external dir and it is not writable, change status to error. $bc->log('Specified backup directory is not writable - ', backup::LOG_ERROR, $dir);