mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-15184: fix sql injection vulnerability
This commit is contained in:
parent
36ea9a6c98
commit
e5e02e4686
1 changed files with 8 additions and 4 deletions
|
@ -380,10 +380,14 @@ function hotpot_delete_selected_attempts(&$hotpot, $del) {
|
||||||
$select = "hotpot=:hotpotid AND status=".HOTPOT_STATUS_ABANDONED;
|
$select = "hotpot=:hotpotid AND status=".HOTPOT_STATUS_ABANDONED;
|
||||||
break;
|
break;
|
||||||
case 'selection':
|
case 'selection':
|
||||||
$ids = (array)data_submitted();
|
$ids = array();
|
||||||
unset($ids['del']);
|
$data = (array)data_submitted();
|
||||||
unset($ids['id']);
|
foreach ($data as $name => $value) {
|
||||||
if (!empty($ids)) {
|
if (preg_match('/^box\d+$/', $name)) {
|
||||||
|
$ids[] = intval($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (count($ids)) {
|
||||||
list($ids, $idparams) = $DB->get_in_or_equal($ids, SQL_PARAMS_NAMED, 'crid0');
|
list($ids, $idparams) = $DB->get_in_or_equal($ids, SQL_PARAMS_NAMED, 'crid0');
|
||||||
$params = array_merge($params, $idparams);
|
$params = array_merge($params, $idparams);
|
||||||
$select = "hotpot=:hotpotid AND clickreportid $ids";
|
$select = "hotpot=:hotpotid AND clickreportid $ids";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue