Commit a1aef069 authored by Arnolds's avatar Arnolds
Browse files

Updated secret-api.php: replaced `strlen` with `mb_strlen` for proper...

Updated secret-api.php: replaced `strlen` with `mb_strlen` for proper multi-byte string length validation in secret length check.
parent 549d367e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ if ($method === 'POST' && isset($data['secret'])) {
        exit;
    }

    if (strlen($data['secret']) > HARD_SECRET_LENGTH_LIMIT) {
    if (mb_strlen($data['secret']) > HARD_SECRET_LENGTH_LIMIT) {
        http_response_code(413); // Content Too Large
        echo json_encode(['error' => '<p class="mb-0">Ai! Lēnāk ar zirgiem 🐎! Tavs noslēpums ir kā romāns trīs sējumos. Mēģini iekļauties ' . SOFT_SECRET_LENGTH_LIMIT . ' simbolos, Hemingvej 📚✂️!</p>']);
        exit;