From 28f493156cd5f8ccbf19d7b1ef13fa77ab4ce635 Mon Sep 17 00:00:00 2001 From: Andrea Adamczyk Date: Thu, 10 Oct 2019 10:39:25 -0400 Subject: [PATCH] PMC-1297 --- .../FixContentDispositionFilenameTest.php | 22 +++++++++++++++++++ .../engine/src/ProcessMaker/Util/helpers.php | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 tests/unit/workflow/engine/src/ProcessMaker/Util/Helpers/FixContentDispositionFilenameTest.php diff --git a/tests/unit/workflow/engine/src/ProcessMaker/Util/Helpers/FixContentDispositionFilenameTest.php b/tests/unit/workflow/engine/src/ProcessMaker/Util/Helpers/FixContentDispositionFilenameTest.php new file mode 100644 index 000000000..fd11c54fe --- /dev/null +++ b/tests/unit/workflow/engine/src/ProcessMaker/Util/Helpers/FixContentDispositionFilenameTest.php @@ -0,0 +1,22 @@ +assertEquals('texttext _text_text', $res); + } +} \ No newline at end of file diff --git a/workflow/engine/src/ProcessMaker/Util/helpers.php b/workflow/engine/src/ProcessMaker/Util/helpers.php index 02b32a94c..d1a415655 100644 --- a/workflow/engine/src/ProcessMaker/Util/helpers.php +++ b/workflow/engine/src/ProcessMaker/Util/helpers.php @@ -488,10 +488,12 @@ function changeAbbreviationOfDirectives($size) function fixContentDispositionFilename($fileName, $replacement = '_') { //(double quote) has to be removed + //(question mark) has to be replaced by underscore due to the issue in google chrome //(forward slash) has to replaced by underscore //(backslash) has to replaced by underscore $default = [ '/[\"]/' => '', + '/[\?]/' => $replacement, '/[\\|\/]/' => $replacement, '/\\\\/' => $replacement ];