Skip to content

Commit 8372216

Browse files
authored
fix(backend): strip commas from attachment filenames generated from email subjects (#1488)
1 parent 38d291f commit 8372216

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/smtp/modules.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,16 @@ public function process() {
141141
if (!is_dir($file_dir)) {
142142
mkdir($file_dir);
143143
}
144-
$name = $msg_header['Subject'] . '.eml';
144+
$basename = str_replace(',', '', $msg_header['Subject']);
145+
$name = $basename. '.eml';
145146
$file_path = $file_dir . $name;
146147
$attached_files[$this->request->get['uid']][] = array(
147148
'name' => $name,
148149
'type' => 'message/rfc822',
149150
'size' => strlen($content),
150151
'tmp_name' => $file_path,
151152
'filename' => $file_path,
152-
'basename' => $msg_header['Subject']
153+
'basename' => $basename
153154
);
154155
$content = Hm_Crypt::ciphertext($content, Hm_Request_Key::generate());
155156
file_put_contents($file_path, $content);

0 commit comments

Comments
 (0)