mirror of https://github.com/MISP/MISP
Revert "new: [event:index] Added support of ANDed tag filtering in the backend"
This reverts commit fc92291092
.
pull/9454/merge
parent
f5f838f3f3
commit
7cf9bcc94c
|
@ -497,11 +497,6 @@ class EventsController extends AppController
|
|||
continue 2;
|
||||
}
|
||||
$pieces = is_array($v) ? $v : explode('|', $v);
|
||||
$isANDed = false;
|
||||
if (count($pieces) == 1 && strpos($pieces[0], '&') !== -1) {
|
||||
$pieces = explode('&', $v);
|
||||
$isANDed = count($pieces) > 1;
|
||||
}
|
||||
$filterString = "";
|
||||
$expectOR = false;
|
||||
$tagRules = [];
|
||||
|
@ -568,19 +563,10 @@ class EventsController extends AppController
|
|||
}
|
||||
|
||||
if (!empty($tagRules['include'])) {
|
||||
if ($isANDed) {
|
||||
$include = $this->Event->EventTag->find('column', array(
|
||||
'conditions' => ['EventTag.tag_id' => $tagRules['include']],
|
||||
'fields' => ['EventTag.event_id'],
|
||||
'group' => ['EventTag.event_id'],
|
||||
'having' => ['COUNT(*) =' => count($tagRules['include'])],
|
||||
));
|
||||
} else {
|
||||
$include = $this->Event->EventTag->find('column', array(
|
||||
'conditions' => array('EventTag.tag_id' => $tagRules['include']),
|
||||
'fields' => ['EventTag.event_id'],
|
||||
));
|
||||
}
|
||||
$include = $this->Event->EventTag->find('column', array(
|
||||
'conditions' => array('EventTag.tag_id' => $tagRules['include']),
|
||||
'fields' => ['EventTag.event_id'],
|
||||
));
|
||||
if (!empty($include)) {
|
||||
$this->paginate['conditions']['AND'][] = 'Event.id IN (' . implode(",", $include) . ')';
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue