From df1cb0b6e3617b55e754b736105895490ebd0a27 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 12 Jul 2023 11:21:32 +0200 Subject: [PATCH] =?UTF-8?q?=20N=C2=B06408=20-=20CRUD=20:=20Fix=20log=20con?= =?UTF-8?q?suming=20too=20much=20memory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/dbobject.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/dbobject.class.php b/core/dbobject.class.php index d94759f4c4..5b1e3dd187 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -612,8 +612,11 @@ protected function _Set($sAttCode, $value) public function Set($sAttCode, $value) { if (!utils::StartsWith(get_class($this), 'CMDBChange') && $this->GetKey() > 0) { - // not all the values have __to_string() so print_r is sed and preferred over var_export for the handling or circular references - $this->LogCRUDEnter(__METHOD__, "$sAttCode => ".print_r($value, true)); + if (is_object($value) || is_array($value)) { + $this->LogCRUDEnter(__METHOD__, "$sAttCode => object or array"); + } else { + $this->LogCRUDEnter(__METHOD__, "$sAttCode => ".print_r($value, true)); + } } $sMessage = $this->IsReadOnly();