From 10ac386fd22a724ec6ca7c5e7125dff3ad2b3699 Mon Sep 17 00:00:00 2001 From: Meirza Date: Thu, 27 Oct 2022 16:46:51 +0700 Subject: [PATCH] MDL-73624 lib_spout: encode output file name --- lib/spout/readme_moodle.txt | 9 +++++++++ lib/spout/src/Spout/Writer/WriterAbstract.php | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/spout/readme_moodle.txt b/lib/spout/readme_moodle.txt index d1fcc1caaab..2fab36e584b 100644 --- a/lib/spout/readme_moodle.txt +++ b/lib/spout/readme_moodle.txt @@ -4,6 +4,15 @@ Description of Spout library import * Only include the src/Spout directory. * Update lib/thirdpartylibs.xml with the latest version. +2022/10/27 +---------- +Changes: +Box/Spout has been archived and is no longer maintained, +MDL-73624 needs to fix with a couple of minor changes to +Writer/WriterAbstract.php. The changes replace rawurldecode() with +rawurlencode() in lines 143 and 144. +by Meirza + 2021/09/01 ---------- Update to v3.3.0 (MDL-71707) diff --git a/lib/spout/src/Spout/Writer/WriterAbstract.php b/lib/spout/src/Spout/Writer/WriterAbstract.php index 36a583fe62f..15e58fdf961 100644 --- a/lib/spout/src/Spout/Writer/WriterAbstract.php +++ b/lib/spout/src/Spout/Writer/WriterAbstract.php @@ -140,8 +140,8 @@ abstract class WriterAbstract implements WriterInterface $this->globalFunctionsHelper->header('Content-Type: ' . static::$headerContentType); $this->globalFunctionsHelper->header( 'Content-Disposition: attachment; ' . - 'filename="' . rawurldecode($this->outputFilePath) . '"; ' . - 'filename*=UTF-8\'\'' . rawurldecode($this->outputFilePath) + 'filename="' . rawurlencode($this->outputFilePath) . '"; ' . + 'filename*=UTF-8\'\'' . rawurlencode($this->outputFilePath) ); /*