Skip to content

Commit

Permalink
MDL-15184: fix sql injection vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
gbateson committed Jul 1, 2008
1 parent 8fd3d38 commit 4fc304c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mod/hotpot/report.php
Expand Up @@ -377,10 +377,14 @@ function hotpot_delete_selected_attempts(&$hotpot, $del) {
$select = "hotpot='$hotpot->id' AND status=".HOTPOT_STATUS_ABANDONED;
break;
case 'selection':
$ids = (array)data_submitted();
unset($ids['del']);
unset($ids['id']);
if (!empty($ids)) {
$ids = array();
$data = (array)data_submitted();
foreach ($data as $name => $value) {
if (preg_match('/^box\d+$/', $name)) {
$ids[] = intval($value);
}
}
if (count($ids)) {
$select = "hotpot='$hotpot->id' AND clickreportid IN (".implode(',', $ids).")";
}
break;
Expand Down

0 comments on commit 4fc304c

Please sign in to comment.