From adb6ff9f58ad59bbd04ab455f322d439cf0621c5 Mon Sep 17 00:00:00 2001 From: natec Date: Mon, 26 Nov 2001 00:50:03 +0000 Subject: [PATCH] Fixed bug 481943. Regexp that normalized linebreaks to \r\n was fucked, so it was changing (char)\n to \r\n and dropping (char). Hence we lost the char before every single linebreak in every email sent thru SMTP. yay. ALso fixed so it gets the FROM address from the right place. git-svn-id: file:///svn/phpbb/trunk@1443 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/emailer.php | 12 ++++++++++-- phpBB/includes/smtp.php | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/emailer.php b/phpBB/includes/emailer.php index 85fe1428c3..b93e61f03c 100755 --- a/phpBB/includes/emailer.php +++ b/phpBB/includes/emailer.php @@ -171,9 +171,17 @@ class emailer // function send() { - global $phpEx; + global $phpEx, $phpbb_root_dir; - $phpbb_root_path = "./"; + if (isset($phpbb_root_dir)) + { + // we must be in the admin section. + $phpbb_root_path = $phpbb_root_dir; + } + else + { + $phpbb_root_path = "./"; + } if ($this->address == NULL) { diff --git a/phpBB/includes/smtp.php b/phpBB/includes/smtp.php index d508031582..13c90e7e80 100644 --- a/phpBB/includes/smtp.php +++ b/phpBB/includes/smtp.php @@ -41,7 +41,7 @@ function server_parse($socket, $response) } if(!(substr($server_response, 0, 3) == $response)) { - message_die(GENERAL_ERROR, "Ran into problems sending Mail", "", __LINE__, __FILE__); + message_die(GENERAL_ERROR, "Ran into problems sending Mail. Response: $server_response", "", __LINE__, __FILE__); } } @@ -63,7 +63,7 @@ function smtpmail($mail_to, $subject, $message, $headers = "") // // Fix any bare linefeeds in the message to make it RFC821 Compliant. // - $message = ereg_replace("[^\r]\n", "\r\n", $message); + $message = preg_replace("/(?