Skip to content

Commit

Permalink
Dev: Return 403 error code
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jul 26, 2021
1 parent 11117c2 commit df909f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion application/controllers/admin/responses.php
Expand Up @@ -791,7 +791,7 @@ public function actionDownloadfile($iSurveyId, $iResponseId, $iQID, $iIndex)
$sFileRealName = $sDir . $aFile['filename'];
$sRealUserPath = realpath($sFileRealName);
if ($sRealUserPath === false || strpos($sRealUserPath, $sDir) !== 0) {
throw new Exception('Directory traversal detected, aborted');
throw new CHttpException(403, "Disable for security reasons.");
} else {
$mimeType = CFileHelper::getMimeType($sFileRealName, null, false);
if (is_null($mimeType)) {
Expand Down

0 comments on commit df909f9

Please sign in to comment.