mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 12:07: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',['']);
|
$this->logger->debug('Add '.count($attachments).' attachments',['']);
|
||||||
|
|
||||||
foreach ($attachments as $attachment) {
|
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) {
|
if ($handle) {
|
||||||
fwrite($handle, $attachment->getContent());
|
fwrite($handle, $attachment->getContent());
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
}
|
}
|
||||||
//Schreibe Anhänge in Datei-Tabelle
|
//Schreibe Anhänge in Datei-Tabelle
|
||||||
$datei = $ordner . '/' . $attachment->getFileName();
|
$datei = $ordner . '/' . $dateiname;
|
||||||
$dateiname = $attachment->getFileName();
|
|
||||||
|
|
||||||
if (stripos(strtoupper($dateiname), '=?UTF-8') !== false) {
|
if (stripos(strtoupper($dateiname), '=?UTF-8') !== false) {
|
||||||
$dateiname = $this->formatter->encodeToUtf8($dateiname);
|
$dateiname = $this->formatter->encodeToUtf8($dateiname);
|
||||||
|
Loading…
Reference in New Issue
Block a user