MDL-20309 improved sanitization of id property; backported from MOODLE_19_STABLE

This commit is contained in:
skodak
2009-09-26 11:58:37 +00:00
parent 7cdae962cc
commit ea05be7926
+3 -1
View File
@@ -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)) {