From 3f5b2ae67ad55d8d9575709ce3446197a7b75ac1 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 5 Nov 2007 22:29:34 +1300 Subject: [PATCH] Another attempt at resolving the URI vs. path issue. See RFC4918, 8.3 --- inc/CalDAVRequest.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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 */