fix: email mask shows max 4 chars instead of half the local part
lizandro.guarnizo (17 chars) was showing 'lizandro.' (9 chars including the dot) because ceil(17/2)=9. Now always shows exactly min(4, len) chars: 'liza*************@domain' Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
9a13bad235
commit
30fc8c0f1b
@@ -1366,8 +1366,8 @@ class TelegramBotService
|
||||
{
|
||||
[$local, $domain] = explode('@', $email, 2);
|
||||
$len = mb_strlen($local);
|
||||
$visible = max(4, (int) ceil($len / 2)); // muestra la mitad, mínimo 4 caracteres
|
||||
return mb_substr($local, 0, min($visible, $len)) . str_repeat('*', max(0, $len - $visible)) . '@' . $domain;
|
||||
$visible = min(4, $len); // siempre 4 caracteres máximo
|
||||
return mb_substr($local, 0, $visible) . str_repeat('*', max(0, $len - $visible)) . '@' . $domain;
|
||||
}
|
||||
|
||||
private function createMPPreference(string $titulo, int $valor, string $ref): ?string
|
||||
|
||||
Reference in New Issue
Block a user