From a54b0167906f06e69b8697b2c25da8e7377878f2 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Fri, 1 Mar 2002 15:46:49 +0000 Subject: [PATCH] Add ability to specify subject within email, format is Subject: (localised subject) followed by carriage return/newline. git-svn-id: file:///svn/phpbb/trunk@2235 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/emailer.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/emailer.php b/phpBB/includes/emailer.php index 12f1ba803e..eceaaca492 100755 --- a/phpBB/includes/emailer.php +++ b/phpBB/includes/emailer.php @@ -71,9 +71,13 @@ class emailer // // set up subject for mail // - function set_subject($subject) + function set_subject($subject = '') { - $this->subject = $subject; + $match = array(); + preg_match("/^(Subject:(.*?)[\r\n]+?)?(.*?)$/is", $this->msg, $match); + + $this->msg = ( isset($match[3]) ) ? trim($match[3]) : ""; + $this->subject = ( $subject != '' ) ? $subject : trim($match[2]); } //