From b0b357f99bee0905ce85317eccc9ac74018dd436 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 18 Aug 2026 21:32:06 +0200 Subject: [PATCH] Strip spaces from generated decode report codes generateSpecialCode() reused generateRandomString(), whose charset includes a space. Across a 75-100 character code that made a space almost certain, and /decode splits its argument on spaces, silently truncating the code the player typed back in - breaking decoding. Fixed at generation time rather than at display time, since the stored value itself was the problem, not just how it's shown. generateRandomString() is left untouched for its other use (the "garbage" filler text shown to players who fail to decode), where spaces are harmless. --- src/Game/Service/GameResponseService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Game/Service/GameResponseService.php b/src/Game/Service/GameResponseService.php index 337b772..5c80806 100644 --- a/src/Game/Service/GameResponseService.php +++ b/src/Game/Service/GameResponseService.php @@ -784,7 +784,9 @@ class GameResponseService private function generateSpecialCode(int $firstDigit, int $min, int $max): string { - $code = $this->generateRandomString($min, $max); + // No spaces: this code gets typed back in as a single /decode argument, + // which is split on spaces, so a space here would silently truncate it. + $code = str_replace(' ', '', $this->generateRandomString($min, $max)); // Ensure the first numeric digit is the specified $firstDigit $found = false;