diff --git a/inc/caldav-MKCALENDAR.php b/inc/caldav-MKCALENDAR.php index def4adbe..d22730ba 100644 --- a/inc/caldav-MKCALENDAR.php +++ b/inc/caldav-MKCALENDAR.php @@ -49,16 +49,26 @@ if ( isset($request->xml_tags) ) { case 'DAV::DISPLAYNAME': $displayname = $content; - dbg_error_log( "MKCALENDAR", "Displayname is '/' to '%s'", $request->path); - $parent_container = $request->path; - $request->path .= $content . '/'; + /** + * TODO: This is definitely a bug in SOHO Organizer and we probably should respond + * with an error, rather than silently doing what they *seem* to want us to do. + */ + if ( preg_match( '/ SOHO Organizer\/6\./', $_SERVER['HTTP_USER_AGENT'] ) ) { + dbg_error_log( "MKCALENDAR", "Displayname is '/' to '%s'", $request->path); + $parent_container = $request->path; + $request->path .= $content . '/'; + } $success[$tag] = 1; break; - case 'DAV::RESOURCETYPE': - /** - * Any value for resourcetype is ignored - */ + case 'URN:IETF:PARAMS:XML:NS:CALDAV:SUPPORTED-CALENDAR-COMPONENT-SET': /** Ignored, since we will support all component types */ + case 'URN:IETF:PARAMS:XML:NS:CALDAV:SUPPORTED-CALENDAR-DATA': /** Ignored, since we will support iCalendar 2.0 */ + case 'URN:IETF:PARAMS:XML:NS:CALDAV:CALENDAR-DATA': /** Ignored, since we will support iCalendar 2.0 */ + case 'URN:IETF:PARAMS:XML:NS:CALDAV:MAX-RESOURCE-SIZE': /** Ignored, since we will support arbitrary size */ + case 'URN:IETF:PARAMS:XML:NS:CALDAV:MIN-DATE-TIME': /** Ignored, since we will support arbitrary time */ + case 'URN:IETF:PARAMS:XML:NS:CALDAV:MAX-DATE-TIME': /** Ignored, since we will support arbitrary time */ + case 'URN:IETF:PARAMS:XML:NS:CALDAV:MAX-INSTANCES': /** Ignored, since we will support arbitrary instances */ + case 'DAV::RESOURCETYPE': /** Any value for resourcetype is ignored */ $success[$tag] = 1; break; diff --git a/testing/tests/regression-suite/507-iCal-MKCALENDAR.result b/testing/tests/regression-suite/507-iCal-MKCALENDAR.result new file mode 100644 index 00000000..f5aeff6b --- /dev/null +++ b/testing/tests/regression-suite/507-iCal-MKCALENDAR.result @@ -0,0 +1,8 @@ +HTTP/1.1 201 Created +Date: Dow, 01 Jan 2000 00:00:00 GMT +DAV: 1, 2, access-control, calendar-access +Cache-Control: no-cache +Content-Length: 0 +Content-Type: text/plain; charset="utf-8" + +10 --- /user1/ --- Untitled --- 1 --- 0 diff --git a/testing/tests/regression-suite/507-iCal-MKCALENDAR.test b/testing/tests/regression-suite/507-iCal-MKCALENDAR.test new file mode 100644 index 00000000..27057e36 --- /dev/null +++ b/testing/tests/regression-suite/507-iCal-MKCALENDAR.test @@ -0,0 +1,29 @@ +# +# MKCALENDAR test for iCal +# +TYPE=MKCALENDAR +URL=http://mycaldav/caldav.php/user1/6E20BB7C-EFD9-4F0F-9BDC-5335E04D47E0/ +HEADER=Content-Type: text/xml +HEAD + + +BEGINDATA + + + + + Untitled + #492BA1FF + + + +ENDDATA + + +QUERY +SELECT user_no, parent_container, dav_displayname, + is_calendar, public_events_only +FROM collection +WHERE dav_name = '/user1/6E20BB7C-EFD9-4F0F-9BDC-5335E04D47E0/'; +ENDQUERY +