diff --git a/includes/functions.php b/includes/functions.php index dc7d12d..3fa9694 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -54,7 +54,10 @@ function honeypot_triggered(): bool function validate_username(string $username, array $rules): array { $errors = []; - $len = mb_strlen($username); + // Uživatelské jméno je o pár řádků níž omezené regexem na čisté ASCII + // (A-Z, 0-9), takže obyčejné strlen() stačí a nepřidává závislost na + // rozšíření mbstring. + $len = strlen($username); if ($len < $rules['username_min'] || $len > $rules['username_max']) { $errors[] = sprintf(