From c559780860ce758846050e4fc9c03df16b2e3ca0 Mon Sep 17 00:00:00 2001 From: Juraj Date: Wed, 10 Jan 2018 14:07:03 +0100 Subject: [PATCH] Fix more PHP notices --- src/CalDAVClient.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/CalDAVClient.php b/src/CalDAVClient.php index f405ea5..f69879d 100644 --- a/src/CalDAVClient.php +++ b/src/CalDAVClient.php @@ -733,12 +733,14 @@ function FindCalendarHome( $recursed=false ) { } $calendar_home = array(); - foreach( $this->xmltags['urn:ietf:params:xml:ns:caldav:calendar-home-set'] AS $k => $v ) { - if ( $this->xmlnodes[$v]['type'] != 'open' ) continue; - while( $this->xmlnodes[++$v]['type'] != 'close' && $this->xmlnodes[$v]['tag'] != 'urn:ietf:params:xml:ns:caldav:calendar-home-set' ) { - // printf( "Tag: '%s' = '%s'\n", $this->xmlnodes[$v]['tag'], $this->xmlnodes[$v]['value']); - if ( $this->xmlnodes[$v]['tag'] == 'DAV::href' && isset($this->xmlnodes[$v]['value']) ) - $calendar_home[] = rawurldecode($this->xmlnodes[$v]['value']); + if (isset($this->xamltags['urn:ietf:params:xml:ns:caldav:calendar-home-set'])) { + foreach( $this->xmltags['urn:ietf:params:xml:ns:caldav:calendar-home-set'] AS $k => $v ) { + if ( $this->xmlnodes[$v]['type'] != 'open' ) continue; + while( $this->xmlnodes[++$v]['type'] != 'close' && $this->xmlnodes[$v]['tag'] != 'urn:ietf:params:xml:ns:caldav:calendar-home-set' ) { + // printf( "Tag: '%s' = '%s'\n", $this->xmlnodes[$v]['tag'], $this->xmlnodes[$v]['value']); + if ( $this->xmlnodes[$v]['tag'] == 'DAV::href' && isset($this->xmlnodes[$v]['value']) ) + $calendar_home[] = rawurldecode($this->xmlnodes[$v]['value']); + } } }