mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-39019 make sure MSSQL does not return non-string data types
This commit is contained in:
parent
422f68fb86
commit
1b64533069
1 changed files with 9 additions and 0 deletions
|
@ -51,6 +51,15 @@ class mssql_native_moodle_recordset extends moodle_recordset {
|
||||||
}
|
}
|
||||||
|
|
||||||
$row = array_change_key_case($row, CASE_LOWER);
|
$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;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue