Properly clone Horde_Mime_Part objects.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 2 Jul 2009 19:28:01 +0000 (13:28 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 2 Jul 2009 19:28:01 +0000 (13:28 -0600)
framework/Mime/lib/Horde/Mime/Part.php

index f445e7f..8d7b606 100644 (file)
@@ -216,6 +216,17 @@ class Horde_Mime_Part
     }
 
     /**
+     * Function to run on clone.
+     */
+    public function __clone()
+    {
+        reset($this->_parts);
+        while (list($k, $v) = each($this->_parts)) {
+            $this->_parts[$k] = clone $v;
+        }
+    }
+
+    /**
      * Set the content-disposition of this part.
      *
      * @param string $disposition  The content-disposition to set (inline or