Fix PHP8 warnings

This commit is contained in:
Aleksander Machniak 2023-08-07 16:16:24 +02:00
parent a1de0c679b
commit 4f2fcfce96

View file

@ -313,7 +313,7 @@ class kolab_storage_config
// Note: this assumes there's only one other users namespace root
if ($ns = $storage->get_namespace('other')) {
if ($prefix = $ns[0][0]) {
list($otheruser, $path) = explode('/', substr($folder, strlen($prefix)), 2);
list($otheruser, $path) = array_pad(explode('/', substr($folder, strlen($prefix)), 2), 2, '');
$folder = 'user/' . $otheruser . $domain . '/' . $path;
}
}
@ -330,7 +330,7 @@ class kolab_storage_config
// UID is optional here because sometimes we want
// to build just a member uri prefix
if ($params['uid']) {
if (!empty($params['uid'])) {
$url .= '/' . $params['uid'];
}