diff --git a/modules/media/jsx/mediaIndex.js b/modules/media/jsx/mediaIndex.js index 1a47b9508fb..8b4c0c71b06 100644 --- a/modules/media/jsx/mediaIndex.js +++ b/modules/media/jsx/mediaIndex.js @@ -113,7 +113,11 @@ class MediaIndex extends Component { + encodeURIComponent(row['File Name']); result = ( - + {cell} diff --git a/php/libraries/FilesDownloadHandler.php b/php/libraries/FilesDownloadHandler.php index fb4c3683ea6..fdae9605a1f 100644 --- a/php/libraries/FilesDownloadHandler.php +++ b/php/libraries/FilesDownloadHandler.php @@ -68,6 +68,7 @@ public function handle(ServerRequestInterface $request) : ResponseInterface } //Use basename to remove path traversal characters. $filename = $request->getAttribute('filename'); + if (empty($filename)) { return new \LORIS\Http\Response\JSON\BadRequest( self::ERROR_EMPTY_FILENAME @@ -75,7 +76,7 @@ public function handle(ServerRequestInterface $request) : ResponseInterface } assert(is_string($filename) || $filename instanceof \Stringable); - $filename = \Utility::resolvePath(strval($filename)); + $filename = urldecode(\Utility::resolvePath(strval($filename))); $targetPath = \Utility::appendForwardSlash( $this->downloadDirectory->getPathname()