From 0a587661a4fe1b39e3c3d1cc444e7689c1e9df70 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 2 Oct 2014 20:06:48 +0200 Subject: [PATCH] Added fallback for empty log-file path --- .../files/lib/system/mail/DebugMailSender.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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)); -- 2.20.1