From cb8bf3f1d1a29c49dca14ace560e57e79f17ef13 Mon Sep 17 00:00:00 2001 From: Thomas de Roo <2+thomas@noreply.localhost> Date: Mon, 15 Jun 2026 12:07:19 +0200 Subject: [PATCH] Update api/answer.php --- api/answer.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/answer.php b/api/answer.php index ba4b0c0..05e61a7 100644 --- a/api/answer.php +++ b/api/answer.php @@ -10,6 +10,13 @@ requireLogin(); $user = $_SESSION['user']; +function normalize(string $s): string +{ + $s = strtolower(trim($s)); + $s = preg_replace('/\s+/', ' ', $s); + return $s; +} + $input = json_decode(file_get_contents('php://input'), true); $lang = $input['lang'];