diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php --- a/lib/Kolab/CalDAV/CalendarBackend.php +++ b/lib/Kolab/CalDAV/CalendarBackend.php @@ -112,13 +112,13 @@ public function get_storage_folder($id) { // resolve alias name - if ($this->aliases[$id]) { + if ($this->aliases[$id] ?? false) { $id = $this->aliases[$id]; } if ($this->folders[$id]) { DAVBackend::check_storage_folder($this->folders[$id]); - return $this->folders[$id]; + return $this->folders[$id] ?? null; } else { return DAVBackend::get_storage_folder($id, ''); @@ -180,11 +180,11 @@ $id = $calendarUri; // resolve aliases (calendar by folder name) - if ($this->aliases[$calendarUri]) { + if ($this->aliases[$calendarUri] ?? false) { $id = $this->aliases[$calendarUri]; } - if ($this->calendars[$id] && empty($this->calendars[$id]['principaluri'])) { + if (($this->calendars[$id] ?? false) && empty($this->calendars[$id]['principaluri'])) { $this->calendars[$id]['principaluri'] = 'principals/' . HTTPBasic::$current_user; } diff --git a/lib/Kolab/DAV/Auth/HTTPBasic.php b/lib/Kolab/DAV/Auth/HTTPBasic.php --- a/lib/Kolab/DAV/Auth/HTTPBasic.php +++ b/lib/Kolab/DAV/Auth/HTTPBasic.php @@ -74,7 +74,7 @@ } // LDAP server failure... send 503 error - if ($auth['kolab_ldap_error']) { + if ($auth['kolab_ldap_error'] ?? false) { throw new ServiceUnavailable('The service is temporarily unavailable (LDAP failure)'); } } @@ -85,8 +85,10 @@ $_SESSION['kolab_auth_vars'] = $auth['vars']; } + $error = null; + $error_str = null; // authenticate user against the IMAP server - $user_id = $auth['abort'] ? 0 : $this->_login($auth['user'], $auth['pass'], $auth['host'], $error); + $user_id = ($auth['abort'] ?? false) ? 0 : $this->_login($auth['user'], $auth['pass'], $auth['host'], $error); if ($user_id) { self::$current_user = $auth['user']; @@ -181,6 +183,7 @@ // parse $host $a_host = parse_url($host); + $port = null; if ($a_host['host']) { $host = $a_host['host']; $ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null;