MDL-39019 make sure MSSQL does not return non-string data types

This commit is contained in:
Petr Škoda 2013-04-08 10:06:55 +02:00
parent 422f68fb86
commit 1b64533069

View file

@ -51,6 +51,15 @@ class mssql_native_moodle_recordset extends moodle_recordset {
}
$row = array_change_key_case($row, CASE_LOWER);
// Moodle expects everything from DB as strings.
foreach ($row as $k=>$v) {
if (is_null($v)) {
continue;
}
if (!is_string($v)) {
$row[$k] = (string)$v;
}
}
return $row;
}