diff --git a/app/Http/Controllers/Passport/CommController.php b/app/Http/Controllers/Passport/CommController.php index c21de2eb..af6c2df7 100644 --- a/app/Http/Controllers/Passport/CommController.php +++ b/app/Http/Controllers/Passport/CommController.php @@ -22,7 +22,7 @@ class CommController extends Controller 'isEmailVerify' => (int)config('v2board.email_verify', 0) ? 1 : 0, 'isInviteForce' => (int)config('v2board.invite_force', 0) ? 1 : 0, 'emailWhitelistSuffix' => (int)config('v2board.email_whitelist_enable', 0) - ? config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT) + ? $this->getEmailSuffix() : 0 ] ]); @@ -74,4 +74,13 @@ class CommController extends Controller '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; + } }