diff options
Diffstat (limited to 'api')
| -rw-r--r-- | api/course/event.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/api/course/event.php b/api/course/event.php index 696d1c5..ce11041 100644 --- a/api/course/event.php +++ b/api/course/event.php @@ -30,7 +30,11 @@ if (random_int(1, 50) === 1) { } $detail = isset($p['detail']) && is_array($p['detail']) ? array_slice($p['detail'], 0, 8, true) : []; -foreach ($detail as $k => $v) { if (is_string($v)) $detail[$k] = substr($v, 0, 300); } +foreach ($detail as $k => $v) { + if (is_string($v)) $detail[$k] = substr($v, 0, 300); + elseif (is_scalar($v)) $detail[$k] = substr((string)$v, 0, 300); + else $detail[$k] = gettype($v); +} $row = ['ts' => gmdate('c'), 'type' => $type, 'sid' => $sid, 'version' => substr((string)($p['version'] ?? ''), 0, 40), 'detail' => $detail]; $out = $dir . '/events-' . date('Ym') . '.jsonl'; |