fix get email whitelist suffix

This commit is contained in:
Tokumeikoi 2020-02-09 18:24:24 +08:00
parent 13bc683faf
commit 5db26d862b

View File

@ -22,7 +22,7 @@ class CommController extends Controller
'isEmailVerify' => (int)config('v2board.email_verify', 0) ? 1 : 0, 'isEmailVerify' => (int)config('v2board.email_verify', 0) ? 1 : 0,
'isInviteForce' => (int)config('v2board.invite_force', 0) ? 1 : 0, 'isInviteForce' => (int)config('v2board.invite_force', 0) ? 1 : 0,
'emailWhitelistSuffix' => (int)config('v2board.email_whitelist_enable', 0) 'emailWhitelistSuffix' => (int)config('v2board.email_whitelist_enable', 0)
? config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT) ? $this->getEmailSuffix()
: 0 : 0
] ]
]); ]);
@ -74,4 +74,13 @@ class CommController extends Controller
'data' => true 'data' => true
]); ]);
} }
private function getEmailSuffix()
{
$suffix = config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT);
if (!is_array($suffix)) {
return preg_split('/,/', $suffix);
}
return $suffix;
}
} }