Add additional logging for OpenPGP

Remove enforcing lower case for email addresses
Small fixes
This commit is contained in:
RainLoop Team 2015-08-26 21:04:50 +03:00
parent 436e54891e
commit 3498700f61
11 changed files with 89 additions and 17 deletions

View file

@ -550,6 +550,22 @@ END;
return \MailSo\Base\Utils::IsAscii($sValue) ? \strtoupper($sValue) : $sValue;
}
/**
* @param string $sValue
*
* @return string
*/
public static function StrMailDomainToLowerIfAscii($sValue)
{
$aParts = \explode('@', $sValue, 2);
if (!empty($aParts[1]))
{
$aParts[1] = \MailSo\Base\Utils::IsAscii($aParts[1]) ? \strtolower($aParts[1]) : $aParts[1];
}
return \implode('@', $aParts);
}
/**
* @param string $sValue
*
@ -2415,7 +2431,7 @@ END;
catch (\Exception $oException) {}
}
return $bLowerIfAscii ? \MailSo\Base\Utils::StrToLowerIfAscii($sStr) : $sStr;
return $bLowerIfAscii ? \MailSo\Base\Utils::StrMailDomainToLowerIfAscii($sStr) : $sStr;
}
/**
@ -2426,7 +2442,7 @@ END;
*/
public static function IdnToAscii($sStr, $bLowerIfAscii = false)
{
$sStr = $bLowerIfAscii ? \MailSo\Base\Utils::StrToLowerIfAscii($sStr) : $sStr;
$sStr = $bLowerIfAscii ? \MailSo\Base\Utils::StrMailDomainToLowerIfAscii($sStr) : $sStr;
$sUser = '';
$sDomain = $sStr;