steffen: server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/framework/iCalendar iCalendar.php, 1.6, 1.7

cvs at intevation.de cvs at intevation.de
Tue Aug 30 01:52:36 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/framework/iCalendar
In directory doto:/tmp/cvs-serv11596/kolab-resource-handlers/fbview/fbview/framework/iCalendar

Modified Files:
	iCalendar.php 
Log Message:
Fix for Issue666 (fbview wrong) and Issue869 (insane freebusy...)

Index: iCalendar.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/fbview/fbview/framework/iCalendar/iCalendar.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- iCalendar.php	26 Jan 2005 07:32:31 -0000	1.6
+++ iCalendar.php	29 Aug 2005 23:52:34 -0000	1.7
@@ -14,6 +14,7 @@
  * @since   Horde 3.0
  * @package Horde_iCalendar
  */
+
 class Horde_iCalendar {
 
     var $_container = null;
@@ -288,12 +289,23 @@
         // Unfold any folded lines.
         $vCal = preg_replace ('/(\r|\n)+ /', '', $vCal);
 
+        // Unfold "quoted printable" folded lines like:
+        //  BODY;ENCODING=QUOTED-PRINTABLE:=
+        //  another=20line=
+        //  last=20line
+        if (preg_match_all('/^([^:]+;\s*ENCODING=QUOTED-PRINTABLE(.*=\r?\n)+(.*[^=])?\r?\n)/mU', $vCal, $matches)) {
+            foreach ($matches[1] as $s) {
+                $r = preg_replace('/=\r?\n/', '', $s);
+                $vCal = str_replace($s, $r, $vCal);
+            }
+        }
+
         // Parse the remaining attributes.
-        if (preg_match_all('/(.*):(.*)(\r|\n)+/', $vCal, $matches)) {
+		if (preg_match_all('/(.*):([^\r\n]*)[\r\n]+/', $vCal, $matches)) {
             foreach ($matches[0] as $attribute) {
-                preg_match('/([^;^:]*)((;[^:]*)?):(.*)/', $attribute, $parts);
+                preg_match('/([^;^:]*)((;.*)?|(;[^:;=]+=(".*"|[^:;=]*))+):([^\r\n]*)[\r\n]*/', $attribute, $parts);
                 $tag = $parts[1];
-                $value = $parts[4];
+                $value = $parts[6];
                 $params = array();
 
                 if (!empty($parts[2])) {





More information about the commits mailing list