Fixed bug #16568: Wrong internal object references after cloning tslib_cObj instances
authorIngo Renner <ingo.renner@typo3.org>
Thu, 25 Nov 2010 15:00:44 +0000 (15:00 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Thu, 25 Nov 2010 15:00:44 +0000 (15:00 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9624 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php

index a24b1ea..4b3c9c3 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-25  Ingo Renner  <ingo@typo3.org>
+
+       * Fixed bug #16568: Wrong internal object references after cloning tslib_cObj instances
+
 2010-11-25  Steffen Kamper  <steffen@typo3.org>
 
        * Follow-up to #16432: wrong markup in livesearch
index b2fac4d..563187b 100644 (file)
@@ -608,6 +608,21 @@ class tslib_cObj {
        }
 
        /**
+        * Clone helper.
+        *
+        * Resets the references to the TypoScript Content Object implementation
+        * objects of tslib_content_*. Otherwise they would still point to the
+        * original tslib_cObj instance's tslib_content_* instances, they in return
+        * would back-reference to the original tslib_cObj instance instead of the
+        * newly cloned tslib_cObj instance.
+        *
+        * @see http://bugs.typo3.org/view.php?id=16568
+        */
+       public function __clone() {
+               $this->contentObjects = array();
+       }
+
+       /**
         * Gets the 'getImgResource' hook objects.
         * The first call initializes the accordant objects.
         *