diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 6670e1b8..ec9ad1f8 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -561,8 +561,10 @@ EOSQL; $params[':request_path'] = $this->path; } $qry = new AwlQuery( $sql, $params ); - if ( $qry->Exec('caldav',__LINE__,__FILE__) && $permission_result = $qry->Fetch() ) - $this->privileges |= bindec($permission_result->perm); + if ( $qry->Exec('caldav',__LINE__,__FILE__) && $permission_result = $qry->Fetch() ) { + $perm = $permission_result->perm; + if (isset($perm)) $this->privileges |= bindec($permission_result->perm); + } dbg_error_log( 'caldav', 'Restricted permissions for user accessing someone elses hierarchy: %s', decbin($this->privileges) ); if ( isset($this->ticket) && $this->ticket->MatchesPath($this->path) ) { diff --git a/inc/DAVResource.php b/inc/DAVResource.php index 41e5209e..c4a919be 100644 --- a/inc/DAVResource.php +++ b/inc/DAVResource.php @@ -474,7 +474,7 @@ EOSQL; $this->collection->type = 'schedule-'. $matches[3]. 'box'; else $this->collection->type = 'collection'; - if ( strlen($row->external_url) > 8 ) { + if ( isset($row->external_url) && strlen($row->external_url) > 8 ) { $this->_is_external = true; if ( $row->external_type == 'calendar' ) $this->collection->type = 'calendar'; diff --git a/inc/caldav-ACL.php b/inc/caldav-ACL.php index 95f7f70c..54ae8dcc 100644 --- a/inc/caldav-ACL.php +++ b/inc/caldav-ACL.php @@ -174,7 +174,8 @@ function process_ace( $grantor, $by_principal, $by_collection, $ace ) { case 'DAV::authenticated': $principal_type = 'authenticated'; - if ( bindec($grantor->GetProperty('default_privileges')) == $privileges ) break; // There is no change, so skip it + $grant_default_privs = $grantor->GetProperty('default_privileges'); + if ( isset($grant_default_privs) && bindec($grant_default_privs) == $privileges ) break; // There is no change, so skip it $sqlparms = array( ':privileges' => $privileges ); if ( isset($by_collection) ) { $sql = 'UPDATE collection SET default_privileges=:privileges::INT::BIT(24) WHERE collection_id=:by_collection'; diff --git a/inc/caldav-PUT-functions.php b/inc/caldav-PUT-functions.php index e2afa3a9..4be240a3 100644 --- a/inc/caldav-PUT-functions.php +++ b/inc/caldav-PUT-functions.php @@ -210,7 +210,8 @@ function handle_schedule_request( $ical ) { dbg_error_log( "PUT", "not delivering to owner" ); continue; } - if ( $attendee->GetParameterValue ( 'PARTSTAT' ) != 'NEEDS-ACTION' || preg_match ( '/^[35]\.[3-9]/', $attendee->GetParameterValue ( 'SCHEDULE-STATUS' ) ) ) { + $schedule_status = $attendee->GetParameterValue ( 'SCHEDULE-STATUS' ); + if ( $attendee->GetParameterValue ( 'PARTSTAT' ) != 'NEEDS-ACTION' || (isset($schedule_status) && preg_match ( '/^[35]\.[3-9]/', $schedule_status ) ) ) { dbg_error_log( "PUT", "attendee %s does not need action", $attendee_email ); continue; } @@ -1430,7 +1431,7 @@ function write_resource( DAVResource $resource, $caldav_data, DAVResource $colle if (strcmp($dtstart, $olddtstart)) $modified = true; $dtend = $first->GetPValue('DTEND'); $olddtend = $oldfirst->GetPValue('DTEND'); - if (strcmp($dtend, $olddtend)) $modified = true; + if (isset($dtend) && isset($olddtend) && strcmp($dtend, $olddtend)) $modified = true; $duration = $first->GetPValue('DURATION'); $oldduration = $oldfirst->GetPValue('DURATION'); $organizer = $vcal->GetOrganizer(); @@ -1468,7 +1469,7 @@ function write_resource( DAVResource $resource, $caldav_data, DAVResource $colle $calitem_params[':due'] = $due; $dtstart = $first->GetPValue('DTSTART'); if ( empty($dtstart) ) $dtstart = $due; - if (preg_match("/^1[0-8][0-9][0-9][01][0-9][0-3][0-9]$/", $dtstart)) + if (isset($dtstart) && preg_match("/^1[0-8][0-9][0-9][01][0-9][0-3][0-9]$/", $dtstart)) $dtstart = $dtstart . "T000000Z"; $calitem_params[':dtstart'] = $dtstart; diff --git a/inc/caldav-REPORT-calquery.php b/inc/caldav-REPORT-calquery.php index 4c4d9874..0c4228c1 100644 --- a/inc/caldav-REPORT-calquery.php +++ b/inc/caldav-REPORT-calquery.php @@ -171,6 +171,9 @@ OR (first_instance_start IS NOT NULL AND ($new_cond)) $search = $v->GetContent(); $negate = $v->GetAttribute("negate-condition"); $collation = $v->GetAttribute("collation"); + if (! isset($collation)) { + $collation = ''; + } switch( strtolower($collation) ) { case 'i;octet': $comparison = 'LIKE';