diff --git a/interface/modules/custom_modules/oe-module-faxsms/src/Controller/EtherFaxActions.php b/interface/modules/custom_modules/oe-module-faxsms/src/Controller/EtherFaxActions.php index 0234b9a099b..29b73491a93 100644 --- a/interface/modules/custom_modules/oe-module-faxsms/src/Controller/EtherFaxActions.php +++ b/interface/modules/custom_modules/oe-module-faxsms/src/Controller/EtherFaxActions.php @@ -180,7 +180,7 @@ public function sendFax(): string // needed args $isContent = $this->getRequest('isContent'); $file = $this->getRequest('file'); - $docId = $this->getRequest('docId'); + $docId = $this->getRequest('docid'); $phone = $this->formatPhone($this->getRequest('phone')); $isDocuments = (int)$this->getRequest('isDocuments'); $email = $this->getRequest('email'); @@ -192,8 +192,14 @@ public function sendFax(): string $tag = $user['username']; if (empty($isContent)) { - $file = str_replace(["file://", "\\"], ['', "/"], realpath($file)); - if (!$file) { + if (str_starts_with($file, 'file://')) { + // Remove the "file://" prefix + $file = substr($file, 7); + } + $realPath = realpath($file); + if ($realPath !== false) { + $file = str_replace("\\", "/", $realPath); + } else { return xlt('Error: No content'); } } @@ -658,7 +664,7 @@ public function setFaxDeleted($jobId): bool public function chartDocument(): string { $pid = $this->getRequest('pid'); - $docId = $this->getRequest('docId'); + $docId = $this->getRequest('docid') ?? $this->getRequest('docId'); $fileName = $this->getRequest('file_name'); $result = $this->chartFaxDocument($pid, $docId, $fileName);