fix: always prepending .

This commit is contained in:
Lawrence Thorpe 2022-06-21 23:47:55 +01:00 committed by GitHub
parent 28678e407a
commit 12b2cd5ec5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,8 +67,11 @@ class AliasController extends Controller
return response('You have reached your hourly limit for creating new aliases', 429);
}
$formatEmail = function(string $localPart, string $domain, string $prefix = '') {
return $prefix . '.' . $localPart . '@' . $domain;
$formatEmail = function(string $localPart, string $domain, string $prefix) {
if (isset($prefix) {
$localPart = $prefix . '.' . $localPart;
}
return $localPart . '@' . $domain;
};
if (isset($request->validated()['local_part'])) {