Skip to content

Commit d47c8c1

Browse files
authored
[mri_violations] Fix links to BrainBrowser from the MRI violations module (#8392)
The links to BrainBrowser from the MRI violations module were not working for two reasons: - queried the wrong table name for the protocol violations (mri_violations_log should have been used instead of mri_violation_log) - the FileDownloadHandler class was using the basename of the file instead of the relative path which resulted in BrainBrowser not finding the file on the file system. These bugs were found when testing #7473 but have been present since 24.0.
1 parent 2a484c0 commit d47c8c1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

modules/brainbrowser/php/imageinfo.class.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class ImageInfo extends \NDB_Page
185185
'' as Visit_label,
186186
MincFile as File,
187187
LogID as FileID
188-
FROM mri_violation_log
188+
FROM mri_violations_log
189189
WHERE LogID IN (" . join(",", $params) .")";
190190
break;
191191
case 'CandidateError':

php/libraries/FilesDownloadHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public function handle(ServerRequestInterface $request) : ResponseInterface
6767
);
6868
}
6969
//Use basename to remove path traversal characters.
70-
$filename = basename(strval($request->getAttribute('filename')));
70+
$filename = \Utility::resolvePath(
71+
strval($request->getAttribute('filename'))
72+
);
7173

7274
if (empty($filename)) {
7375
return new \LORIS\Http\Response\JSON\BadRequest(

0 commit comments

Comments
 (0)