mirror of https://github.com/MISP/MISP
chg: [user:saveNotificationSettings] Make sure tags filter is a valid json
parent
b2174754ec
commit
90cab66b86
|
@ -2783,11 +2783,11 @@ class UsersController extends AppController
|
|||
if (!empty($success)) {
|
||||
$message = __('Notification settings saved');
|
||||
$this->Flash->success($message);
|
||||
$this->redirect(['action' => 'view', 'me']);
|
||||
} else {
|
||||
$message = __('Notification settings could not be saved');
|
||||
$this->Flash->error($message);
|
||||
}
|
||||
$this->redirect(['action' => 'view', 'me']);
|
||||
}
|
||||
$user['periodic_settings'] = $this->User->extractPeriodicSettingForUser($user);
|
||||
$this->request->data = $user;
|
||||
|
|
|
@ -1695,6 +1695,10 @@ class User extends AppModel
|
|||
]);
|
||||
if ($success) {
|
||||
$periodic_settings = $data['periodic_settings'];
|
||||
$decodedTags = json_decode($periodic_settings['tags'], true);
|
||||
if ($decodedTags === null) {
|
||||
return false;
|
||||
}
|
||||
$notification_filters = [
|
||||
'orgc_id' => $periodic_settings['orgc_id'] ?? [],
|
||||
'published' => $periodic_settings['published'] ?? '',
|
||||
|
|
Loading…
Reference in New Issue