Fix default URL for FindPrincipal() ensure If-Match etag is quoted.

This commit is contained in:
Andrew McMillan 2012-04-04 22:59:28 +12:00
parent 200b3a08dd
commit cfbb0bd6f3

View File

@ -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);