Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[media] Fix SQL injection #8908

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions modules/media/ajax/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function getUploadFields()
$mediaData = $db->pselectRow(
"SELECT " .
"m.session_id as sessionID, " .
"(SELECT PSCID from candidate WHERE CandID=s.CandID) as pscid, " .
"c.PSCID as pscid, " .
"Visit_label as visitLabel, " .
"instrument, " .
"CenterID as forSite, " .
Expand All @@ -358,9 +358,10 @@ function getUploadFields()
"file_name as fileName, " .
"hide_file as hideFile, " .
"language_id as language," .
"m.id FROM media m LEFT JOIN session s ON m.session_id = s.ID " .
"WHERE m.id = $idMediaFile",
[]
"m.id FROM media m LEFT JOIN session s ON m.session_id = s.ID
LEFT JOIN candidate c ON (c.CandID=s.CandID) " .
"WHERE m.id = :mediaId",
['mediaId' => $idMediaFile]
);
}

Expand Down
Loading