MDL-20309 improved sanitization of id property; backported from MOODLE_19_STABLE
This commit is contained in:
+3
-1
@@ -1498,9 +1498,11 @@ function update_record($table, $dataobject) {
|
||||
|
||||
global $db, $CFG;
|
||||
|
||||
if (! isset($dataobject->id) ) {
|
||||
// integer value in id propery required
|
||||
if (empty($dataobject->id)) {
|
||||
return false;
|
||||
}
|
||||
$dataobject->id = (int)$dataobject->id;
|
||||
|
||||
/// Check we are handling a proper $dataobject
|
||||
if (is_array($dataobject)) {
|
||||
|
||||
Reference in New Issue
Block a user