瀏覽代碼

#887 short term fix for preventing ToArgs to alter the content of an object...

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3095 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 11 年之前
父節點
當前提交
3a724d1bf3
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      core/dbobject.class.php
  2. 1 1
      core/dbobjectset.class.php

+ 1 - 1
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)
 					{

+ 1 - 1
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
 		}
 	}