From 595e724426ce252d03cfb2bcf7471179edc552e6 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Tue, 4 Jan 2011 18:46:51 +1300 Subject: [PATCH] Fix bug in handling bound resources with DAVResource changes. Signed-off-by: Andrew McMillan --- inc/caldav-PROPFIND.php | 7 +++++-- testing/tests/binding/1005-PROPFIND-bound.result | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/inc/caldav-PROPFIND.php b/inc/caldav-PROPFIND.php index 2b3e3cfd..957e166c 100644 --- a/inc/caldav-PROPFIND.php +++ b/inc/caldav-PROPFIND.php @@ -115,7 +115,7 @@ function get_collection_contents( $depth, $collection, $parent_path = null ) { $responses = array(); if ( ! $collection->IsCalendar() && ! $collection->IsAddressbook() ) { /** - * Calendar/Addressbook collections may not contain collections, so we won't look + * Calendar/Addressbook collections may not contain collections, so we are only looking in the other ones */ $params = array( ':session_principal' => $session->principal_id, ':scan_depth' => $c->permission_scan_depth ); if ( $bound_from == '/' ) { @@ -204,8 +204,11 @@ function get_collection_contents( $depth, $collection, $parent_path = null ) { $qry = new AwlQuery( $sql, array( ':collection_dav_name' => $bound_from) ); if( $qry->Exec('PROPFIND',__LINE__,__FILE__) && $qry->rows() > 0 ) { while( $item = $qry->Fetch() ) { + if ( $bound_from != $bound_to ) { + $item->bound_from = $item->dav_name; + $item->dav_name = str_replace($bound_from,$bound_to,$item->dav_name); + } $resource = new DAVResource($item); - $resource->set_bind_location( str_replace($bound_from,$bound_to,$item->dav_name)); $responses[] = $resource->RenderAsXML($property_list, $reply, $parent_path ); } } diff --git a/testing/tests/binding/1005-PROPFIND-bound.result b/testing/tests/binding/1005-PROPFIND-bound.result index 87a410d3..a61ef531 100644 --- a/testing/tests/binding/1005-PROPFIND-bound.result +++ b/testing/tests/binding/1005-PROPFIND-bound.result @@ -6,7 +6,7 @@ User 2's Calendar, as uploaded by Admin - /user4/ + /caldav.php/user2/