diff --git a/inc/caldav-REPORT-sync-collection.php b/inc/caldav-REPORT-sync-collection.php index 349bd87c..34de6302 100644 --- a/inc/caldav-REPORT-sync-collection.php +++ b/inc/caldav-REPORT-sync-collection.php @@ -37,7 +37,10 @@ $collection = new DAVResource( $request->path ); if ( !$collection->Exists() ) { $request->DoResponse( 404 ); } - +$bound_from = $collection->bound_from(); +$collection_path = $collection->dav_name(); +$request_via_binding = ($bound_from != $collection_path); + $params = array( ':collection_id' => $collection->GetProperty('collection_id'), ':sync_token' => $sync_token ); $sql = "SELECT new_sync_token( :sync_token, :collection_id)"; $qry = new AwlQuery($sql, $params); @@ -101,6 +104,9 @@ EOSQL; $c->sync_resource_data_ok = false; } while( $object = $qry->Fetch() ) { + if ( $request_via_binding ) + $object->dav_name = str_replace( $bound_from, $collection_path, $object->dav_name); + if ( $object->dav_name == $last_dav_name ) { /** The complex case: this is the second or subsequent for this dav_id */ if ( $object->sync_status == 404 ) { diff --git a/testing/tests/binding/1036-REPORT-sync-initial-bound.result b/testing/tests/binding/1036-REPORT-sync-initial-bound.result index a34dd13d..b84bf95e 100644 --- a/testing/tests/binding/1036-REPORT-sync-initial-bound.result +++ b/testing/tests/binding/1036-REPORT-sync-initial-bound.result @@ -2,14 +2,14 @@ HTTP/1.1 207 Multi-Status Date: Dow, 01 Jan 2000 00:00:00 GMT DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule -ETag: "51330ec2c1868a584176caf2d8b0b195" -Content-Length: 2292 +ETag: "7aa94bdf662d6b03f844eaf18239d0a8" +Content-Length: 2301 Content-Type: text/xml; charset="utf-8" - /caldav.php/user2/home/33169d69-2969-4a96-a3e1-2e312b7614e6.ics + /caldav.php/user4/user2/33169d69-2969-4a96-a3e1-2e312b7614e6.ics "f2c974ff51cb52cde0668544deb36380" @@ -18,7 +18,7 @@ Content-Type: text/xml; charset="utf-8" - /caldav.php/user2/home/047871e3-6b70-4178-9af8-0ceb50f7b092.ics + /caldav.php/user4/user2/047871e3-6b70-4178-9af8-0ceb50f7b092.ics "58cba7e3fafb6080e85619ea77d08c7a" @@ -27,7 +27,7 @@ Content-Type: text/xml; charset="utf-8" - /caldav.php/user2/home/9429a973-2b13-4b1a-be09-948d75425c45.ics + /caldav.php/user4/user2/9429a973-2b13-4b1a-be09-948d75425c45.ics "13249ced6c7527191a003f54f7e3cd25" @@ -36,7 +36,7 @@ Content-Type: text/xml; charset="utf-8" - /caldav.php/user2/home/7d729xc0-0895-012d-124e-002421a2359e.ics + /caldav.php/user4/user2/7d729xc0-0895-012d-124e-002421a2359e.ics "848df16c32fc3ce319083ae84c2603a3" @@ -45,7 +45,7 @@ Content-Type: text/xml; charset="utf-8" - /caldav.php/user2/home/bd262d20-1cdb-012d-1264-002421a2359e.ics + /caldav.php/user4/user2/bd262d20-1cdb-012d-1264-002421a2359e.ics "671d4ee904be6c16dd1be076619fe7c0" @@ -54,7 +54,7 @@ Content-Type: text/xml; charset="utf-8" - /caldav.php/user2/home/56f0e0e0-f742-012d-680c-002421a2359e.ics + /caldav.php/user4/user2/56f0e0e0-f742-012d-680c-002421a2359e.ics "e18c0d539b6dcb56df2d266dd4305008" @@ -63,7 +63,7 @@ Content-Type: text/xml; charset="utf-8" - /caldav.php/user2/home/thiswillworkfine.ics + /caldav.php/user4/user2/thiswillworkfine.ics "9a8d7696ee2e0a0f1f4170fe4f094a3a" @@ -72,7 +72,7 @@ Content-Type: text/xml; charset="utf-8" - /caldav.php/user2/home/thiswillalsobegood.ics + /caldav.php/user4/user2/thiswillalsobegood.ics "1c7895f11787e71fd6dbe3260d72d4a0" @@ -81,7 +81,7 @@ Content-Type: text/xml; charset="utf-8" - /caldav.php/user2/home/70399cd7-50a4-4be4-a665-af593e19a7fd.ics + /caldav.php/user4/user2/70399cd7-50a4-4be4-a665-af593e19a7fd.ics "ea6b316ca24db20f5eb37d1abd60f8c1"