MDL-39027 make sure sqlsrv does not return non-string data types

This commit is contained in:
Petr Škoda 2013-04-08 12:43:50 +02:00
parent 422f68fb86
commit 60e9a2fe5d

View File

@ -93,6 +93,15 @@ class sqlsrv_native_moodle_recordset extends moodle_recordset {
unset($row['sqlsrvrownumber']);
$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;
}