mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
MDL-39027 make sure sqlsrv does not return non-string data types
This commit is contained in:
parent
422f68fb86
commit
60e9a2fe5d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user