mirror of https://github.com/MISP/MISP
chg: [logbehaviour] skipfields reverted to an array from a constant
- keeps ancient PHP versions happy (as happy as anyone can be knowing they run ancient PHP versions)pull/7694/head
parent
96b4f86c62
commit
9d7da3103f
|
@ -16,7 +16,7 @@ class AuditLogBehavior extends ModelBehavior
|
||||||
private $enabled;
|
private $enabled;
|
||||||
|
|
||||||
// Hash is faster that in_array
|
// Hash is faster that in_array
|
||||||
const SKIP_FIELDS = [
|
private $skipFields = [
|
||||||
'id' => true,
|
'id' => true,
|
||||||
'lastpushedid' => true,
|
'lastpushedid' => true,
|
||||||
'timestamp' => true,
|
'timestamp' => true,
|
||||||
|
@ -292,7 +292,7 @@ class AuditLogBehavior extends ModelBehavior
|
||||||
$dbFields = $model->schema();
|
$dbFields = $model->schema();
|
||||||
$changedFields = [];
|
$changedFields = [];
|
||||||
foreach ($model->data[$model->alias] as $key => $value) {
|
foreach ($model->data[$model->alias] as $key => $value) {
|
||||||
if (isset(self::SKIP_FIELDS[$key])) {
|
if (isset($this->skipFields[$key])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!isset($dbFields[$key])) {
|
if (!isset($dbFields[$key])) {
|
||||||
|
|
Loading…
Reference in New Issue