Skip to content

Commit

Permalink
[Media] Fix SQL injection vulnerability (#3349)
Browse files Browse the repository at this point in the history
Fixed query in media module to use a prepared statement.
  • Loading branch information
davidblader authored and driusan committed Dec 20, 2017
1 parent 8ffba39 commit e7fcfb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/media/php/NDB_Form_media.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class NDB_Form_Media extends NDB_Form
// Check if media file exists, if not redirect to /media/ page
if (isset($idMediaFile)) {
$result = $db->pselectRow(
"SELECT id FROM media WHERE id = $idMediaFile",
[]
"SELECT id FROM media WHERE id = :mid",
array('mid' => $idMediaFile)
);
if (count($result) < 1) {
header('Location: ' . $baseURL . '/media/');
Expand Down

0 comments on commit e7fcfb1

Please # to comment.