diff --git a/system/Database/BaseUtils.php b/system/Database/BaseUtils.php index 0ebe693f3981..35ff0627ac9d 100644 --- a/system/Database/BaseUtils.php +++ b/system/Database/BaseUtils.php @@ -214,7 +214,7 @@ public function getCSVFromResult(ResultInterface $query, string $delim = ',', st $line = []; foreach ($row as $item) { - $line[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $item ?? '') . $enclosure; + $line[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, (string) $item ?? '') . $enclosure; } $out .= implode($delim, $line) . $newline; @@ -246,7 +246,7 @@ public function getXMLFromResult(ResultInterface $query, array $params = []): st $xml .= $tab . '<' . $element . '>' . $newline; foreach ($row as $key => $val) { - $val = (! empty($val)) ? xml_convert($val) : ''; + $val = (! empty($val)) ? xml_convert((string) $val) : ''; $xml .= $tab . $tab . '<' . $key . '>' . $val . '' . $newline; }