From bcf81bce4d2483fb397fe1bcdacc766a8df45c7a Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 3 Aug 2025 22:33:51 +0900 Subject: [PATCH] Prevent infinite addition of sequence numbers to $_SESSION --- common/legacy.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/legacy.php b/common/legacy.php index d1499de9d..4a1e8177e 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -244,6 +244,10 @@ function setUserSequence($seq): void } $seq = intval($seq); $_SESSION['seq'][$seq] = $seq; + if (count($_SESSION['seq']) > 1000) + { + $_SESSION['seq'] = array_slice($_SESSION['seq'], 600, null, true); + } } /**