Skip to content

Commit

Permalink
Mangled path fax send (openemr#7515)
Browse files Browse the repository at this point in the history
normalize file path from document controller for fax send
sjpadgett authored Jun 22, 2024
1 parent 674f8ea commit 0cfa65e
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 0cfa65e

Please sign in to comment.