From 97e5b661c960c16a9a19969c1519771e2c75434c Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 5 Mar 2015 15:47:48 -0600
Subject: [PATCH] thread: Add poster name to third-party post banner

---
 include/class.thread.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/class.thread.php b/include/class.thread.php
index ce03a4a26..f80007022 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -742,9 +742,10 @@ Class ThreadEntry {
         else {
             //XXX: Are we potentially leaking the email address to
             // collaborators?
-            $header = sprintf("Received From: %s\n\n", $mailinfo['email']);
+            $header = sprintf("Received From: %s <%s>\n\n", $mailinfo['name'],
+                $mailinfo['email']);
             if ($body instanceof HtmlThreadBody)
-                $header = nl2br($header);
+                $header = nl2br(Format::htmlchars($header));
             // Add the banner to the top of the message
             if ($body instanceof ThreadBody)
                 $body->prepend($header);
-- 
GitLab