From cfc27891023a2728328f155860a286aae7cb8bfc Mon Sep 17 00:00:00 2001 From: Agando Date: Sun, 18 Oct 2026 14:19:47 +0200 Subject: newOS4 course: post-exec review fixes (telemetry detail sanitize, skill-sync retry, atlas check) --- api/course/event.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'api/course/event.php') 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'; -- cgit v1.2.3