From 7e7647c1594fc009a071b6b24bbf2eff5c5b2dfd Mon Sep 17 00:00:00 2001 From: Markus Stenudd Date: Sat, 30 Nov 2013 16:01:26 +0100 Subject: [PATCH 1/2] [ticket/8558] Add display name in emails from board PHPBB3-8558 --- phpBB/includes/functions_messenger.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index db2dea33e8..333914f02f 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -488,12 +488,12 @@ class messenger if (empty($this->replyto)) { - $this->replyto = '<' . $config['board_contact'] . '>'; + $this->replyto = '"' . $config['sitename'] . '" <' . $config['board_contact'] . '>'; } if (empty($this->from)) { - $this->from = '<' . $config['board_contact'] . '>'; + $this->from = '"' . $config['sitename'] . '" <' . $config['board_contact'] . '>'; } $encode_eol = ($config['smtp_delivery']) ? "\r\n" : $this->eol; From e0151abdb5372176e4139307390d71de18a39dca Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Wed, 16 Apr 2014 17:48:05 +0200 Subject: [PATCH 2/2] [ticket/8558] Do string concatenation only once and do htmlspecialchars PHPBB3-8558 --- phpBB/includes/functions_messenger.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 333914f02f..a303bdac57 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -486,14 +486,16 @@ class messenger $use_queue = true; } + $board_contact = '"' . mail_encode(htmlspecialchars($config['sitename'])) . '" <' . $config['board_contact'] . '>'; + if (empty($this->replyto)) { - $this->replyto = '"' . $config['sitename'] . '" <' . $config['board_contact'] . '>'; + $this->replyto = $board_contact; } if (empty($this->from)) { - $this->from = '"' . $config['sitename'] . '" <' . $config['board_contact'] . '>'; + $this->from = $board_contact; } $encode_eol = ($config['smtp_delivery']) ? "\r\n" : $this->eol;