mirror of https://github.com/MISP/MISP
chg: [internal] Change method name to show that it just filter one attr
parent
e54482c77e
commit
b031ad3a07
|
@ -3542,7 +3542,7 @@ class Attribute extends AppModel
|
|||
if (!empty($options['includeEventTags'])) {
|
||||
$results = $this->__attachEventTagsToAttributes($eventTags, $results, $key, $options);
|
||||
}
|
||||
if ($options['enforceWarninglist'] && !$this->Warninglist->filterWarninglistAttributes($attribute['Attribute'])) {
|
||||
if ($options['enforceWarninglist'] && !$this->Warninglist->filterWarninglistAttribute($attribute['Attribute'])) {
|
||||
continue;
|
||||
}
|
||||
if ($options['includeWarninglistHits']) {
|
||||
|
@ -4119,7 +4119,7 @@ class Attribute extends AppModel
|
|||
}
|
||||
if (!empty($attribute['enforceWarninglist']) || !empty($params['enforceWarninglist'])) {
|
||||
$this->Warninglist = ClassRegistry::init('Warninglist');
|
||||
if (!$this->Warninglist->filterWarninglistAttributes($attribute)) {
|
||||
if (!$this->Warninglist->filterWarninglistAttribute($attribute)) {
|
||||
$this->validationErrors['warninglist'] = 'Attribute could not be saved as it trips over a warninglist and enforceWarninglist is enforced.';
|
||||
$validationErrors = $this->validationErrors['warninglist'];
|
||||
$log->create();
|
||||
|
|
|
@ -6170,7 +6170,7 @@ class Event extends AppModel
|
|||
}
|
||||
// adhere to the warninglist
|
||||
if ($adhereToWarninglists) {
|
||||
if (!$this->Warninglist->filterWarninglistAttributes($attribute)) {
|
||||
if (!$this->Warninglist->filterWarninglistAttribute($attribute)) {
|
||||
if ($adhereToWarninglists === 'soft') {
|
||||
$attribute['to_ids'] = 0;
|
||||
} else {
|
||||
|
|
|
@ -553,7 +553,7 @@ class MispObject extends AppModel
|
|||
if (empty($options['metadata'])) {
|
||||
foreach ($results as $key => $object) {
|
||||
foreach ($object['Attribute'] as $key2 => $attribute) {
|
||||
if ($options['enforceWarninglist'] && !$this->Warninglist->filterWarninglistAttributes($attribute['Attribute'])) {
|
||||
if ($options['enforceWarninglist'] && !$this->Warninglist->filterWarninglistAttribute($attribute['Attribute'])) {
|
||||
unset($results[$key][$key2]);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -688,7 +688,7 @@ class Warninglist extends AppModel
|
|||
* @param array|null $warninglists If null, all enabled warninglists will be used
|
||||
* @return bool
|
||||
*/
|
||||
public function filterWarninglistAttributes(array $attribute, $warninglists = null)
|
||||
public function filterWarninglistAttribute(array $attribute, $warninglists = null)
|
||||
{
|
||||
if ($warninglists === null) {
|
||||
$warninglists = $this->getEnabled();
|
||||
|
|
Loading…
Reference in New Issue