mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Validate FCM service account JSON content
This commit is contained in:
parent
c7f96ad75b
commit
296f37f5f5
3 changed files with 12 additions and 0 deletions
|
|
@ -183,6 +183,16 @@ class Notification extends Base
|
|||
}
|
||||
$push_config[$driver_name][$conf_name] = $conf_value;
|
||||
|
||||
// Validate the FCM service account.
|
||||
if ($conf_name === 'service_account' && $conf_value !== null)
|
||||
{
|
||||
$decoded_value = @json_decode($conf_value, true);
|
||||
if (!$decoded_value || !isset($decoded_value['project_id']) || !isset($decoded_value['private_key']))
|
||||
{
|
||||
throw new Exception('msg_advanced_mailer_invalid_fcm_json');
|
||||
}
|
||||
}
|
||||
|
||||
// Save certificates in a separate file and only store the filename in config.php.
|
||||
if ($conf_name === 'certificate' || $conf_name === 'service_account')
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue