Added fallback for empty log-file path
authorMarcel Werk <burntime@woltlab.com>
Thu, 2 Oct 2014 18:06:48 +0000 (20:06 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 2 Oct 2014 18:06:48 +0000 (20:06 +0200)
wcfsetup/install/files/lib/system/mail/DebugMailSender.class.php

index 647245dcef5ee5042e767f0aca55369cc25b4165..fce9359c687582266ce4dbd6d86fd2616bf339fa 100644 (file)
@@ -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));