From 5db26d862b4d03737a2acadcb39e1ed3b48e3d90 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Sun, 9 Feb 2020 18:24:24 +0800 Subject: [PATCH] fix get email whitelist suffix --- app/Http/Controllers/Passport/CommController.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; + } }