Re-add the $clear parameter instead.
authorJan Schneider <jan@horde.org>
Wed, 20 Oct 2010 16:21:04 +0000 (18:21 +0200)
committerJan Schneider <jan@horde.org>
Thu, 21 Oct 2010 08:47:57 +0000 (10:47 +0200)
framework/Icalendar/lib/Horde/Icalendar.php

index b61a8e2..12f7e9d 100644 (file)
@@ -540,13 +540,16 @@ class Horde_Icalendar
      *
      * @param string $text     The data to parse.
      * @param string $base     The type of the base object.
+     * @param boolean $clear   If true clears this object before parsing.
      *
      * @return boolean  True on successful import, false otherwise.
      * @throws Horde_Icalendar_Exception
      */
-    public function parsevCalendar($text, $base = 'VCALENDAR')
+    public function parsevCalendar($text, $base = 'VCALENDAR', $clear = true)
     {
-        $this->_attributes = $this->_components = array();
+        if ($clear) {
+            $this->clear();
+        }
 
         if (preg_match('/^BEGIN:' . $base . '(.*)^END:' . $base . '/ism', $text, $matches)) {
             $container = true;