Fix PHP8 warnings
This commit is contained in:
parent
b258585da1
commit
28711f7e6e
10 changed files with 18 additions and 14 deletions
|
@ -945,7 +945,7 @@ class kolab_calendar extends kolab_storage_folder_api
|
|||
$out = '';
|
||||
if (is_array($prop)) {
|
||||
foreach ($prop as $key => $val) {
|
||||
if (is_numeric($key)) {
|
||||
if (is_numeric($key) || is_array($val)) {
|
||||
$out .= self::_complex2string($val);
|
||||
}
|
||||
else if (!in_array($key, $ignorekeys)) {
|
||||
|
|
|
@ -227,7 +227,7 @@ class kolab_driver extends calendar_driver
|
|||
}
|
||||
}
|
||||
|
||||
if ($cal->subscriptions) {
|
||||
if (!empty($cal->subscriptions)) {
|
||||
$calendars[$cal->id]['subscribed'] = $cal->is_subscribed();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,14 +109,14 @@ class kolab_activesync_ui
|
|||
|
||||
public function folder_subscriptions($attrib = [])
|
||||
{
|
||||
if (!$attrib['id']) {
|
||||
if (empty($attrib['id'])) {
|
||||
$attrib['id'] = 'foldersubscriptions';
|
||||
}
|
||||
|
||||
// group folders by type (show only known types)
|
||||
$folder_groups = ['mail' => [], 'contact' => [], 'event' => [], 'task' => [], 'note' => []];
|
||||
$folder_types = kolab_storage::folders_typedata();
|
||||
$use_fieldsets = rcube_utils::get_boolean($attrib['use-fieldsets']);
|
||||
$use_fieldsets = rcube_utils::get_boolean($attrib['use-fieldsets'] ?? '');
|
||||
$imei = $this->device['_id'];
|
||||
$subscribed = [];
|
||||
|
||||
|
|
|
@ -617,6 +617,7 @@ class libcalendaring_itip
|
|||
|
||||
$rsvp_status = 'unknown';
|
||||
$rsvp_buttons = '';
|
||||
$title = '';
|
||||
|
||||
// pass some metadata about the event and trigger the asynchronous status check
|
||||
$changed = !empty($event['changed']) && is_object($event['changed']) ? $event['changed'] : $message_date;
|
||||
|
|
|
@ -199,7 +199,7 @@ class kolab_date_recurrence
|
|||
|
||||
$event['start'] = $start;
|
||||
$event['recurrence']['INTERVAL'] = $interval;
|
||||
if ($event['recurrence']['COUNT']) {
|
||||
if (!empty($event['recurrence']['COUNT'])) {
|
||||
// Increase count so we do not stop the loop to early
|
||||
$event['recurrence']['COUNT'] += 100;
|
||||
}
|
||||
|
|
|
@ -350,7 +350,7 @@ class kolab_format_contact extends kolab_format
|
|||
$teltypes = array_flip($this->phonetypes);
|
||||
for ($i=0; $i < $tels->size(); $i++) {
|
||||
$tel = $tels->get($i);
|
||||
$object['phone'][] = array('number' => $tel->number(), 'type' => $teltypes[$tel->types()]);
|
||||
$object['phone'][] = ['number' => $tel->number(), 'type' => $teltypes[$tel->types()] ?? null];
|
||||
}
|
||||
|
||||
$object['notes'] = $this->obj->note();
|
||||
|
|
|
@ -53,7 +53,9 @@ class kolab_format_task extends kolab_format_xcal
|
|||
// set common xcal properties
|
||||
parent::set($object);
|
||||
|
||||
$this->obj->setPercentComplete(intval($object['complete']));
|
||||
$object['complete'] = (int) ($object['complete'] ?? 0);
|
||||
|
||||
$this->obj->setPercentComplete($object['complete']);
|
||||
|
||||
$status = kolabformat::StatusUndefined;
|
||||
if ($object['complete'] == 100 && !array_key_exists('status', $object))
|
||||
|
|
|
@ -516,8 +516,8 @@ class kolab_storage
|
|||
self::setup();
|
||||
|
||||
$folder = rcube_charset::convert($prop['name'], RCUBE_CHARSET, 'UTF7-IMAP');
|
||||
$oldfolder = $prop['oldname']; // UTF7
|
||||
$parent = $prop['parent']; // UTF7
|
||||
$oldfolder = $prop['oldname'] ?? ''; // UTF7
|
||||
$parent = $prop['parent'] ?? ''; // UTF7
|
||||
$delimiter = self::$imap->get_hierarchy_delimiter();
|
||||
|
||||
if (strlen($oldfolder)) {
|
||||
|
@ -1083,7 +1083,7 @@ class kolab_storage
|
|||
array_pop($path);
|
||||
$parent_parent = join($delim, $path);
|
||||
|
||||
if (!$refs[$parent]) {
|
||||
if (empty($refs[$parent])) {
|
||||
if ($folder->type && self::folder_type($parent) == $folder->type) {
|
||||
$refs[$parent] = new kolab_storage_folder($parent, $folder->type, $folder->type);
|
||||
$refs[$parent]->parent = $parent_parent;
|
||||
|
@ -1095,6 +1095,7 @@ class kolab_storage
|
|||
$name = kolab_storage::object_name($parent);
|
||||
$refs[$parent] = new kolab_storage_folder_virtual($parent, $name, $folder->get_namespace(), $parent_parent);
|
||||
}
|
||||
|
||||
$parents[] = $refs[$parent];
|
||||
}
|
||||
}
|
||||
|
@ -1259,7 +1260,7 @@ class kolab_storage
|
|||
}
|
||||
|
||||
return in_array($folder, self::$subscriptions) ||
|
||||
($temp && in_array($folder, (array)$_SESSION['kolab_subscribed_folders']));
|
||||
($temp && in_array($folder, $_SESSION['kolab_subscribed_folders'] ?? []));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1727,7 +1728,7 @@ class kolab_storage
|
|||
}
|
||||
|
||||
if (empty($user) && ($ldap = self::ldap())) {
|
||||
$user = $ldap->get_user_record($token, $_SESSION['imap_host']);
|
||||
$user = $ldap->get_user_record($token, $_SESSION['imap_host'] ?? '');
|
||||
|
||||
if (!empty($user)) {
|
||||
$keys = array('displayname', 'name', 'mail'); // supported keys
|
||||
|
|
|
@ -37,7 +37,7 @@ class kolab_storage_cache_contact extends kolab_storage_cache
|
|||
$sql_data = parent::_serialize($object);
|
||||
$sql_data['type'] = $object['_type'];
|
||||
|
||||
$email = is_array($object['email'] ?? null) ? $object['email'][0] : ($object['email'] ?? '');
|
||||
$email = is_array($object['email'] ?? null) ? ($object['email'][0] ?? '') : ($object['email'] ?? '');
|
||||
|
||||
// columns for sorting
|
||||
$sql_data['name'] = rcube_charset::clean(($object['name'] ?? '') . ($object['prefix'] ?? ''));
|
||||
|
|
|
@ -552,7 +552,7 @@ class kolab_storage_config
|
|||
$tag['members'] = array_merge($tag['members'], $members);
|
||||
|
||||
// add UIDs into the result
|
||||
$result[$folder] = array_unique(array_merge((array)$result[$folder], $uids));
|
||||
$result[$folder] = array_unique(array_merge((array) ($result[$folder] ?? []), $uids));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue