Add CardDAV support for Apple's latest Addressbook.app

This commit is contained in:
Jörg Lehrke 2010-04-21 17:44:36 +00:00
parent 334a8c6fc3
commit 50ff02da4d
2 changed files with 14 additions and 3 deletions

View File

@ -136,8 +136,8 @@ class groupdav extends HTTP_WebDAV_Server
case 'davkit': // iCal app in OS X 10.6 created wrong request, if full url given case 'davkit': // iCal app in OS X 10.6 created wrong request, if full url given
$this->client_require_href_as_url = false; $this->client_require_href_as_url = false;
break; break;
case 'cfnetwork': case 'cfnetwork_old':
$this->crrnd = true; // Apple Addressbook.app does not cope with namespace redundancy $this->crrnd = true; // Older Apple Addressbook.app does not cope with namespace redundancy
} }
parent::HTTP_WebDAV_Server(); parent::HTTP_WebDAV_Server();

View File

@ -347,6 +347,17 @@ abstract class groupdav_handler
{ {
error_log("Unrecogniced GroupDAV client: HTTP_USER_AGENT='$_SERVER[HTTP_USER_AGENT]'!"); error_log("Unrecogniced GroupDAV client: HTTP_USER_AGENT='$_SERVER[HTTP_USER_AGENT]'!");
} }
else
{
switch ($agent)
{
case 'cfnetwork':
if (preg_match('/address%20book\/([0-9.]+)/', $user_agent, $matches))
{
if ((int)$matches[1] < 868) $agent .= '_old';
}
}
}
} }
return $agent; return $agent;
} }