mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 23:08:08 +08:00
DomainPathHelper
This commit is contained in:
parent
b71be47059
commit
66d8fe1b96
1 changed files with 14 additions and 2 deletions
|
@ -3322,10 +3322,22 @@ class Actions
|
|||
{
|
||||
$sDomain = \strtolower(\trim($sDomain));
|
||||
|
||||
$sDomainPrefix = \substr(\preg_replace('/[^a-z0-9]+/', '', $sDomain), 0, 2);
|
||||
$sTempDomain = \preg_replace('/^(webmail|email|mail|www|ssl)\./', '', $sDomain);
|
||||
if (false === \strpos($sTempDomain, '.'))
|
||||
{
|
||||
$sTempDomain = $sDomain;
|
||||
}
|
||||
|
||||
$sDomainPrefix = $sTempDomain;
|
||||
if (false === \strpos($sDomainPrefix, '.'))
|
||||
{
|
||||
$sDomainPrefix = $sTempDomain;
|
||||
}
|
||||
|
||||
$sDomainPrefix = \substr(\preg_replace('/[^a-z0-9]+/', '', $sDomainPrefix), 0, 2);
|
||||
$sDomainPrefix = \str_pad($sDomainPrefix, 2, '_');
|
||||
|
||||
return 'domains/'.$sDomainPrefix.'/'.\urlencode($sDomain);
|
||||
return 'd/'.\substr($sDomainPrefix, 0, 1).'/'.$sDomainPrefix.'/'.\urlencode($sTempDomain);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue