From: Marcel Werk Date: Thu, 2 Oct 2014 18:06:48 +0000 (+0200) Subject: Added fallback for empty log-file path X-Git-Tag: 2.1.0_Alpha_1~286 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a587661a4fe1b39e3c3d1cc444e7689c1e9df70;p=GitHub%2FWoltLab%2FWCF.git Added fallback for empty log-file path --- diff --git a/wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php b/wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php index 647245dcef..fce9359c68 100644 --- a/wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php +++ b/wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php @@ -28,7 +28,15 @@ class DebugMailSender extends MailSender { */ public function sendMail(Mail $mail) { if ($this->log === null) { - $this->log = new File(FileUtil::addTrailingSlash(MAIL_DEBUG_LOGFILE_PATH).'mail.log', 'ab'); + $logFilePath = ''; + if (MAIL_DEBUG_LOGFILE_PATH) { + $logFilePath = FileUtil::addTrailingSlash(MAIL_DEBUG_LOGFILE_PATH); + } + else { + $logFilePath = WCF_DIR . 'log/'; + } + + $this->log = new File($logFilePath . 'mail.log', 'ab'); } $this->log->write($this->printMail($mail));