Another attempt at resolving the URI vs. path issue. See RFC4918, 8.3

This commit is contained in:
Andrew McMillan 2007-11-05 22:29:34 +13:00
parent b491ee17fd
commit 3f5b2ae67a

View File

@ -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
*/