summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Flatz2019-10-28 16:48:03 +0100
committerDavid Flatz2019-10-28 16:48:03 +0100
commit0ae61813817c38450bb7b03ca27cfa569ede35c8 (patch)
tree512f4e96d34bede849c7928db1f067e0a70c5f91
parent55597357c715484494bc7ef58ee36a6d0e5b63f6 (diff)
downloaditools-0ae61813817c38450bb7b03ca27cfa569ede35c8.tar.gz
itools-0ae61813817c38450bb7b03ca27cfa569ede35c8.tar.bz2
itools-0ae61813817c38450bb7b03ca27cfa569ede35c8.zip
escape attachment name since that string is user-provided and might contain non-ascii characters
-rw-r--r--it_mail.class3
1 files changed, 2 insertions, 1 deletions
diff --git a/it_mail.class b/it_mail.class
index 4033c06..3e56a08 100644
--- a/it_mail.class
+++ b/it_mail.class
@@ -276,7 +276,8 @@ function send($p = array())
foreach ($this->attachments as $attachment)
{
- $text .= "\n--$boundary\nContent-Type: {$attachment['mimetype']}; name=\"{$attachment['name']}\"\nContent-Transfer-Encoding: base64\nContent-ID: <{$attachment['cid']}>\nContent-Disposition: {$attachment['disposition']}; filename=\"{$attachment['name']}\"\n\n";
+ $name = $this->header_escape($attachment['name']);
+ $text .= "\n--$boundary\nContent-Type: {$attachment['mimetype']}; name=\"$name\"\nContent-Transfer-Encoding: base64\nContent-ID: <{$attachment['cid']}>\nContent-Disposition: {$attachment['disposition']}; filename=\"$name\"\n\n";
$text .= chunk_split(base64_encode($attachment['data']));
}