From cfbb0bd6f3baf12c212261f020d1c997f0822509 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 4 Apr 2012 22:59:28 +1200 Subject: [PATCH] Fix default URL for FindPrincipal() ensure If-Match etag is quoted. --- inc/caldav-client-v2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/caldav-client-v2.php b/inc/caldav-client-v2.php index dbedae1a..9d4db7d6 100644 --- a/inc/caldav-client-v2.php +++ b/inc/caldav-client-v2.php @@ -120,7 +120,7 @@ class CalDAVClient { * @param string $etag The etag to match / not match against. */ function SetMatch( $match, $etag = '*' ) { - $this->headers['match'] = sprintf( "%s-Match: %s", ($match ? "If" : "If-None"), $etag); + $this->headers['match'] = sprintf( "%s-Match: \"%s\"", ($match ? "If" : "If-None"), trim($etag,'"')); } /** @@ -599,7 +599,7 @@ class CalDAVClient { * * @param string $url The URL to find the principal-URL from */ - function FindPrincipal( $url ) { + function FindPrincipal( $url=null ) { $xml = $this->DoPROPFINDRequest( $url, array('resourcetype', 'current-user-principal', 'owner', 'principal-URL', 'urn:ietf:params:xml:ns:caldav:calendar-home-set'), 1);