mirror of https://github.com/MISP/MISP
Merge pull request #8654 from JakubOnderka/controller-json-decode
chg: [internal] Use specific controller version of jsonDecodepull/8656/head
commit
e358e13130
|
@ -266,7 +266,7 @@ class EventReportsController extends AppController
|
|||
$report = $this->EventReport->fetchIfAuthorized($this->Auth->user(), $reportId, 'edit', $throwErrors=true, $full=false);
|
||||
if ($this->request->is('post')) {
|
||||
$errors = [];
|
||||
$suggestions = $this->EventReport->jsonDecode($this->data['EventReport']['suggestions']);
|
||||
$suggestions = $this->_jsonDecode($this->data['EventReport']['suggestions']);
|
||||
if (!empty($suggestions['content']) && !empty($suggestions['mapping'])) {
|
||||
$errors = $this->EventReport->applySuggestions($this->Auth->user(), $report, $suggestions['content'], $suggestions['mapping']);
|
||||
} else {
|
||||
|
@ -336,7 +336,7 @@ class EventReportsController extends AppController
|
|||
{
|
||||
$event = $this->__canModifyReport($eventId);
|
||||
if ($this->request->is('post') || $this->request->is('put')) {
|
||||
$filters = $this->EventReport->jsonDecode($this->data['EventReport']['filters']);
|
||||
$filters = $this->_jsonDecode($this->data['EventReport']['filters']);
|
||||
$options['conditions'] = $filters;
|
||||
$options['conditions'] = array_filter($filters, function($v) {
|
||||
return $v !== '';
|
||||
|
|
|
@ -2790,7 +2790,7 @@ class EventsController extends AppController
|
|||
if (is_numeric($idList) || Validation::uuid($idList)) {
|
||||
$idList = array($idList);
|
||||
} else {
|
||||
$idList = $this->Event->jsonDecode($idList);
|
||||
$idList = $this->_jsonDecode($idList);
|
||||
}
|
||||
}
|
||||
if (empty($idList)) {
|
||||
|
@ -5309,8 +5309,8 @@ class EventsController extends AppController
|
|||
throw new ForbiddenException(__('You don\'t have permission to do that.'));
|
||||
}
|
||||
|
||||
$resolved_data = $this->Event->jsonDecode($this->request->data['Event']['JsonObject']);
|
||||
$data = $this->Event->jsonDecode($this->request->data['Event']['data']);
|
||||
$resolved_data = $this->_jsonDecode($this->request->data['Event']['JsonObject']);
|
||||
$data = $this->_jsonDecode($this->request->data['Event']['data']);
|
||||
if (!empty($data['initialObject'])) {
|
||||
$resolved_data['initialObject'] = $data['initialObject'];
|
||||
}
|
||||
|
|
|
@ -503,7 +503,7 @@ class ServersController extends AppController
|
|||
$this->Flash->error($error_msg);
|
||||
}
|
||||
}
|
||||
$pushRules = $this->Server->jsonDecode($this->request->data['Server']['push_rules']);
|
||||
$pushRules = $this->_jsonDecode($this->request->data['Server']['push_rules']);
|
||||
$this->loadModel('Tag');
|
||||
foreach ($pushRules['tags'] as $operator => $list) {
|
||||
foreach ($list as $i => $tagName) {
|
||||
|
|
|
@ -1123,7 +1123,7 @@ class UsersController extends AppController
|
|||
}
|
||||
if ($this->request->is('post') || $this->request->is('put')) {
|
||||
$jsonIds = $this->request->data['User']['user_ids'];
|
||||
$ids = $this->User->jsonDecode($jsonIds);
|
||||
$ids = $this->_jsonDecode($jsonIds);
|
||||
$conditions = ['User.id' => $ids];
|
||||
if (!$this->_isSiteAdmin()) {
|
||||
$conditions['User.org_id'] = $this->Auth->user('org_id');
|
||||
|
|
Loading…
Reference in New Issue