mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Bugfix for #756
This commit is contained in:
parent
079f334bcc
commit
4397eaed86
1 changed files with 4 additions and 1 deletions
|
|
@ -21,8 +21,11 @@ abstract class SASL
|
||||||
final public static function factory(string $type)
|
final public static function factory(string $type)
|
||||||
{
|
{
|
||||||
if (\preg_match('/^([A-Z2]+)(?:-(.+))?$/Di', $type, $m)) {
|
if (\preg_match('/^([A-Z2]+)(?:-(.+))?$/Di', $type, $m)) {
|
||||||
|
if ('XOAUTH2' === $m[1] || 'OAUTHBEARER' === $m[1]) {
|
||||||
|
$m[1] = 'OAUTH';
|
||||||
|
}
|
||||||
$class = __CLASS__ . "\\{$m[1]}";
|
$class = __CLASS__ . "\\{$m[1]}";
|
||||||
if (\class_exists($class)) {
|
if (\class_exists($class) && $class::isSupported($m[2] ?? '')) {
|
||||||
return new $class($m[2] ?? '');
|
return new $class($m[2] ?? '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue