From 2574a0c8a43d8bb264f1fdf2c2677629da7e23b4 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Tue, 4 Mar 2014 13:58:28 +0000 Subject: [PATCH] #887 short term fix for preventing ToArgs to alter the content of an object... SVN:trunk[3095] --- core/dbobject.class.php | 2 +- core/dbobjectset.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 8c0880fe0..b58832f3d 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -2051,7 +2051,7 @@ abstract class DBObject { $sRemoteName = $oAttDef->IsIndirect() ? $oAttDef->GetExtKeyToRemote().'_friendlyname' : 'friendlyname'; - $oLinkSet = $this->Get($sAttCode); + $oLinkSet = clone $this->Get($sAttCode); // Workaround/Safety net for Trac #887 $iLimit = MetaModel::GetConfig()->Get('max_linkset_output'); if ($iLimit > 0) { diff --git a/core/dbobjectset.class.php b/core/dbobjectset.class.php index b5015d416..fc00fd564 100644 --- a/core/dbobjectset.class.php +++ b/core/dbobjectset.class.php @@ -418,7 +418,7 @@ class DBObjectSet CMDBSource::FreeResult($resQuery); $this->m_iCount = $aRow['COUNT']; } - return $this->m_iCount; + return $this->m_iCount; // WARNING this value can be wrong, see Trac #887 } }