mirror of
https://github.com/bs-community/blessing-skin-plugins.git
synced 2025-01-09 12:17:54 +08:00
[restricted-email-domains] fix possible json structure error
This commit is contained in:
parent
41f63895f9
commit
fca19f3c00
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "restricted-email-domains",
|
||||
"title": "Blessing\\RestrictedEmailDomains::general.title",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"description": "Blessing\\RestrictedEmailDomains::general.description",
|
||||
"author": "GPlane",
|
||||
"url": "https://gplane.win/",
|
||||
|
@ -20,14 +20,16 @@ class ConfigController extends Controller
|
||||
$allowList = json_decode(option('restricted-email-domains.allow', '[]'), true);
|
||||
$denyList = json_decode(option('restricted-email-domains.deny', '[]'), true);
|
||||
|
||||
return ['allow' => $allowList, 'deny' => $denyList];
|
||||
return [
|
||||
'allow' => array_values($allowList),
|
||||
'deny' => array_values($denyList),
|
||||
];
|
||||
}
|
||||
|
||||
public function save(Request $request, $list)
|
||||
{
|
||||
option([
|
||||
"restricted-email-domains.$list" => json_encode($request->input()),
|
||||
]);
|
||||
$json = json_encode(array_values($request->input()));
|
||||
option(["restricted-email-domains.$list" => $json]);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user