From 2808bab03b2b3cf5810cd4ab699cb10911c342d2 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 20 May 2012 21:42:54 +1200 Subject: [PATCH] Simplify using GetPath() method. --- inc/caldav-REPORT-sync-collection.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/inc/caldav-REPORT-sync-collection.php b/inc/caldav-REPORT-sync-collection.php index f5ddced9..b2e10be9 100644 --- a/inc/caldav-REPORT-sync-collection.php +++ b/inc/caldav-REPORT-sync-collection.php @@ -36,13 +36,12 @@ if ( !isset($sync_token) ) $sync_token = 0; $sync_token = intval(str_ireplace('data:,', '', $sync_token )); dbg_error_log( 'sync', " sync-token: %s", $sync_token ); - -$props = $xmltree->GetElements('DAV::prop'); -$v = $props[0]; -$props = $v->GetContent(); $proplist = array(); -foreach( $props AS $k => $v ) { - $proplist[] = $v->GetNSTag(); +$props = $xmltree->GetPath('/DAV::sync-collection/DAV::prop/*'); +if ( !empty($props) ) { + foreach( $props AS $k => $v ) { + $proplist[] = $v->GetNSTag(); + } } function display_status( $status_code ) {