Ticket system bugfixes with filename handling

This commit is contained in:
Xenomporio
2022-08-20 11:59:32 +02:00
parent 84cd447f49
commit 954eebcdc1
3 changed files with 13 additions and 5 deletions
@@ -145,8 +145,11 @@ final class SystemMailer
$email = new EmailMessage($subject, $body, $recipients, $ccs, $bccs);
foreach ($attachFiles as $file) {
$this->logger->debug("Attaching file", ['filename' => $file]);
if ($file !== null && file_exists($file)) {
$email->addAttachment(new FileAttachment($file));
} else {
$this->logger->debug("Attaching file failed", ['filename' => $file]);
}
}
@@ -769,7 +769,7 @@ class TicketImportHelper
$dateiname = $this->formatter->encodeToUtf8($dateiname);
$dateiname = htmlspecialchars_decode($dateiname);
}
if (stripos(strtoupper($dateiname), 'UTF-8\'\'') == 0) {
if (stripos(strtoupper($dateiname), 'UTF-8\'\'') === 0) {
$dateiname = $this->formatter->encodeToUtf8(urldecode(substr($dateiname,7)));
$dateiname = htmlspecialchars_decode($dateiname);
}