From bd1874acb7af1619583f7368b57872a43199a3ab Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 12 Jun 2020 17:48:22 +0200 Subject: [PATCH] only log updates if model is changed --- Controller/ApiController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 5bd31d4..0906d18 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -106,6 +106,11 @@ final class ApiController extends Controller { $oldString = StringUtils::stringify($old, \JSON_PRETTY_PRINT); $newString = StringUtils::stringify($new, \JSON_PRETTY_PRINT); + + if ($oldString === $newString) { + return; + } + $audit = new Audit(new NullAccount($account), $oldString, $newString, $type, $subtype, $module, $ref, $content, \ip2long($ip ?? '127.0.0.1')); AuditMapper::create($audit);