]> git.mxchange.org Git - friendica.git/commitdiff
Fixes several notices
authorMichael <heluecht@pirati.ca>
Sat, 19 Sep 2020 03:16:26 +0000 (03:16 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 19 Sep 2020 03:16:26 +0000 (03:16 +0000)
mod/events.php
src/Model/Contact.php
src/Model/Mail.php

index d82fbd818e4094058c6ab3d5bc383f74492e246f..695432e2a4b89db8f955bcd5477dc97b82369da5 100644 (file)
@@ -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)) {
index 97c281e1a1441b51f3060fbee20e4fad3405942d..3d3583b6bf70ad915ab80b1d7e817a27f7687b11 100644 (file)
@@ -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();
                }
 
index 67d5d1ddca3371a9152ccce1bffe7ae3c369410d..12b4985526b9a9b137dfa7f07b84e36ce0f9e1d8 100644 (file)
@@ -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;
                }