diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 40707d87..ecb93ed5 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -72,6 +72,15 @@ class CalDAVRequest $this->user_agent = ((isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "Probably Mulberry")); + /** + * In general we systematically return Absolute URI hrefs. Unfortunately some + * software doesn't expect this to happen (iCal, SOHO Organizer, ???) and so we + * need to hack around these programs. RFC4918 section 8.3 gives details. + */ + if ( preg_match( '/(iCal 3.0|SOHO Organizer|ChronosCalendarsService)/', $this->user_agent ) ) { + $c->protocol_server_port_script = preg_replace('#^(http|caldav)s?://[^/]+#', '', $c->protocol_server_port_script ); + } + /** * A variety of requests may set the "Depth" header to control recursion */