From 7e7dd6b4fc7aa45ba2a8f6b6fcbf591b8eaa4b35 Mon Sep 17 00:00:00 2001 From: Lukas Scharmer Date: Tue, 17 Dec 2024 16:35:02 +0100 Subject: [PATCH] Chatroom: Add missing typecast for JS timestamps (ms) --- components/ILIAS/Chatroom/classes/class.ilChatroom.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ILIAS/Chatroom/classes/class.ilChatroom.php b/components/ILIAS/Chatroom/classes/class.ilChatroom.php index 26d9f26d03ae..015f53b2b11f 100755 --- a/components/ILIAS/Chatroom/classes/class.ilChatroom.php +++ b/components/ILIAS/Chatroom/classes/class.ilChatroom.php @@ -806,8 +806,8 @@ public function getLastMessages(int $number, ilChatroomUser $chatuser): array } usort($results, static function (stdClass $a, stdClass $b): int { - $a_timestamp = strlen((string) $a->timestamp) === 13 ? ((int) substr($a->timestamp, 0, -3)) : $a->timestamp; - $b_timestamp = strlen((string) $b->timestamp) === 13 ? ((int) substr($b->timestamp, 0, -3)) : $b->timestamp; + $a_timestamp = strlen((string) $a->timestamp) === 13 ? ((int) substr((string) $a->timestamp, 0, -3)) : $a->timestamp; + $b_timestamp = strlen((string) $b->timestamp) === 13 ? ((int) substr((string) $b->timestamp, 0, -3)) : $b->timestamp; return $b_timestamp - $a_timestamp; });