mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 03:57:15 +01:00
bugfix tickets attachments with problematich characters in filename
This commit is contained in:
parent
b34505b088
commit
9775c873c9
@ -799,15 +799,18 @@ class TicketImportHelper
|
||||
$this->logger->debug('Add '.count($attachments).' attachments',['']);
|
||||
|
||||
foreach ($attachments as $attachment) {
|
||||
if ($attachment->getFileName() !== '') {
|
||||
$handle = fopen($ordner . '/' . $attachment->getFileName(), 'wb');
|
||||
|
||||
$dateiname = $attachment->getFileName();
|
||||
$dateiname = str_replace(array('\\','/',':','*','?','"','<','>','|'),' ',$dateiname); // Remove problematic characters
|
||||
|
||||
if ($dateiname !== '') {
|
||||
$handle = fopen($ordner . '/' . $dateiname, 'wb');
|
||||
if ($handle) {
|
||||
fwrite($handle, $attachment->getContent());
|
||||
fclose($handle);
|
||||
}
|
||||
//Schreibe Anhänge in Datei-Tabelle
|
||||
$datei = $ordner . '/' . $attachment->getFileName();
|
||||
$dateiname = $attachment->getFileName();
|
||||
$datei = $ordner . '/' . $dateiname;
|
||||
|
||||
if (stripos(strtoupper($dateiname), '=?UTF-8') !== false) {
|
||||
$dateiname = $this->formatter->encodeToUtf8($dateiname);
|
||||
|
Loading…
Reference in New Issue
Block a user