From 59d2b7a4a14b3b7d9d3a6bf9f94554a83598e163 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 6 Aug 2024 14:11:53 +0100 Subject: [PATCH] Add null check in data dump --- settings_extras.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings_extras.php b/settings_extras.php index dee67e30..182bf23b 100644 --- a/settings_extras.php +++ b/settings_extras.php @@ -111,7 +111,7 @@ $datarow = get_object_vars($datarow); $output .= "|"; foreach ($datarow as $datacell) { - $output .= ' '.htmlspecialchars(str_pad(substr($datacell, 0, $columnwidth), $columnwidth, " ", 1)).'|'; + $output .= ' '.htmlspecialchars(str_pad(substr($datacell ?? '', 0, $columnwidth), $columnwidth, " ", 1)).'|'; } if ($table == 'turnitintooltwo_users' && $moodleusers[$datarow['userid']]) { $firstname = format_string($moodleusers[$datarow['userid']]->firstname);