Skip to content

downloadReport function is returning the wrong directory seperator on linux #42

@nlhooper

Description

@nlhooper

The downloadReport funciton in ExternalConfiguration.php is using a hardcoded backslash in the returned path, which is incorrect on Linux. (apologies I dont know why the line breaks arent appearing in the code block):

function downloadReport($downloadData, $fileName){ $filePathName = __DIR__. DIRECTORY_SEPARATOR .$fileName; $file = fopen($filePathName, "w"); fwrite($file, $downloadData); fclose($file); return __DIR__.'\\'.$fileName; }

It should use the php constant DIRECTORY_SEPARATOR and as the path is already stored in the filePathName variable the return fucntion can be corrected to
return $filePathName;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions