diff --git a/classes/Modules/SystemMailer/SystemMailer.php b/classes/Modules/SystemMailer/SystemMailer.php index 5e7c1a70..67c9c7bd 100644 --- a/classes/Modules/SystemMailer/SystemMailer.php +++ b/classes/Modules/SystemMailer/SystemMailer.php @@ -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]); } } diff --git a/classes/Modules/Ticket/Task/TicketImportHelper.php b/classes/Modules/Ticket/Task/TicketImportHelper.php index 74cb5c61..e0ce9408 100644 --- a/classes/Modules/Ticket/Task/TicketImportHelper.php +++ b/classes/Modules/Ticket/Task/TicketImportHelper.php @@ -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); } diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php index ac1d4177..e3003891 100644 --- a/www/lib/class.erpapi.php +++ b/www/lib/class.erpapi.php @@ -43887,7 +43887,7 @@ function Firmendaten($field,$projekt="") if(empty($pathArr) || !is_dir($prefix.'/'.implode('/', $pathArr))) { return; } - $glob = glob($prefix.implode('/', $pathArr).'/*'); + $glob = glob($prefix.implode('/', $pathArr).'/*'); /*/* if(!empty($glob)) { return; } @@ -43985,6 +43985,9 @@ function Firmendaten($field,$projekt="") return strtolower($tmp['extension']); } + /* + * Retrieve files from stichwoerter and provide them in tmp for access + */ function GetDateiSubjektObjektDateiname($subjekt,$objekt,$parameter,$prefix="") { @@ -43994,11 +43997,13 @@ function Firmendaten($field,$projekt="") } $tmp = []; foreach($dateien as $datei) { - $tmpname = tempnam($this->GetTMP(), $prefix); - $newname = $tmpname."_".$this->GetDateiName($datei['datei']); - copy($this->GetDateiPfad($datei['datei']),$newname); // Why in the world..?! +// $tmpname = tempnam($this->GetTMP(), $prefix); + $tmpname = $this->GetTMP().md5(uniqid(mt_rand(), true)); + mkdir ($tmpname); + $newname = $tmpname."/".$this->GetDateiName($datei['datei']); + copy($this->GetDateiPfad($datei['datei']),$newname); $tmp[] = $newname; } return $tmp;