diff --git a/mod/events.php b/mod/events.php index d82fbd818..695432e2a 100644 --- a/mod/events.php +++ b/mod/events.php @@ -474,16 +474,16 @@ function events_content(App $a) $t_orig = $orig_event['summary'] ?? ''; $d_orig = $orig_event['desc'] ?? ''; $l_orig = $orig_event['location'] ?? ''; - $eid = !empty($orig_event) ? $orig_event['id'] : 0; - $cid = !empty($orig_event) ? $orig_event['cid'] : 0; - $uri = !empty($orig_event) ? $orig_event['uri'] : ''; + $eid = $orig_event['id'] ?? 0; + $cid = $orig_event['cid'] ?? 0; + $uri = $orig_event['uri'] ?? ''; if ($cid || $mode === 'edit') { $share_disabled = 'disabled="disabled"'; } - $sdt = !empty($orig_event) ? $orig_event['start'] : 'now'; - $fdt = !empty($orig_event) ? $orig_event['finish'] : 'now'; + $sdt = $orig_event['start'] ?? 'now'; + $fdt = $orig_event['finish'] ?? 'now'; $tz = date_default_timezone_get(); if (!empty($orig_event)) { diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 97c281e1a..3d3583b6b 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1909,7 +1909,7 @@ class Contact $ret['pubkey'] = $new_pubkey; } - if (($ret['addr'] != $contact['addr']) || (!empty($ret['alias']) && ($ret['alias'] != $contact['alias']))) { + if ((!empty($ret['addr']) && ($ret['addr'] != $contact['addr'])) || (!empty($ret['alias']) && ($ret['alias'] != $contact['alias']))) { $ret['uri-date'] = DateTimeFormat::utcNow(); } diff --git a/src/Model/Mail.php b/src/Model/Mail.php index 67d5d1ddc..12b498552 100644 --- a/src/Model/Mail.php +++ b/src/Model/Mail.php @@ -129,9 +129,12 @@ class Mail } $me = DBA::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]); - $contact = DBA::selectFirst('contact', [], ['id' => $recipient, 'uid' => local_user()]); + if (!DBA::isResult($me)) { + return -2; + } - if (!(count($me) && (count($contact)))) { + $contact = DBA::selectFirst('contact', [], ['id' => $recipient, 'uid' => local_user()]); + if (!DBA::isResult($contact)) { return -2; } diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index 949417ccf..cdac7d91f 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -125,7 +125,7 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";