mirror of https://github.com/MISP/MISP
chg: [internal] Use strict comparison for in_array
parent
5f1762dbc0
commit
5f78f6a2d5
|
@ -364,18 +364,18 @@ class Feed extends AppModel
|
|||
$redisResultToAttributePosition = [];
|
||||
|
||||
foreach ($attributes as $k => $attribute) {
|
||||
if (in_array($attribute['type'], $this->Attribute->nonCorrelatingTypes)) {
|
||||
if (in_array($attribute['type'], $this->Attribute->nonCorrelatingTypes, true)) {
|
||||
continue; // attribute type is not correlateable
|
||||
}
|
||||
if (!empty($attribute['disable_correlation'])) {
|
||||
continue; // attribute correlation is disabled
|
||||
}
|
||||
|
||||
if (in_array($attribute['type'], $compositeTypes)) {
|
||||
if (in_array($attribute['type'], $compositeTypes, true)) {
|
||||
list($value1, $value2) = explode('|', $attribute['value']);
|
||||
$parts = [$value1];
|
||||
|
||||
if (!in_array($attribute['type'], $this->Attribute->primaryOnlyCorrelatingTypes)) {
|
||||
if (!in_array($attribute['type'], $this->Attribute->primaryOnlyCorrelatingTypes, true)) {
|
||||
$parts[] = $value2;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -480,7 +480,7 @@ class Warninglist extends AppModel
|
|||
|
||||
if ($object['to_ids'] || $this->showForAll) {
|
||||
foreach ($warninglists as $list) {
|
||||
if (in_array('ALL', $list['types']) || in_array($object['type'], $list['types'])) {
|
||||
if (in_array('ALL', $list['types'], true) || in_array($object['type'], $list['types'], true)) {
|
||||
$result = $this->__checkValue($this->getFilteredEntries($list), $object['value'], $object['type'], $list['Warninglist']['type']);
|
||||
if ($result !== false) {
|
||||
$object['warnings'][] = array(
|
||||
|
@ -689,7 +689,7 @@ class Warninglist extends AppModel
|
|||
$tlds[$key] = strtolower($value);
|
||||
}
|
||||
}
|
||||
if (!in_array('onion', $tlds)) {
|
||||
if (!in_array('onion', $tlds, true)) {
|
||||
$tlds[] = 'onion';
|
||||
}
|
||||
return $tlds;
|
||||
|
@ -707,7 +707,7 @@ class Warninglist extends AppModel
|
|||
}
|
||||
|
||||
foreach ($warninglists as $warninglist) {
|
||||
if (in_array('ALL', $warninglist['types']) || in_array($attribute['type'], $warninglist['types'])) {
|
||||
if (in_array('ALL', $warninglist['types'], true) || in_array($attribute['type'], $warninglist['types'], true)) {
|
||||
$result = $this->__checkValue($this->getFilteredEntries($warninglist), $attribute['value'], $attribute['type'], $warninglist['Warninglist']['type']);
|
||||
if ($result !== false) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue