diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/connections.php | 2 | ||||
-rw-r--r-- | include/event.php | 27 | ||||
-rw-r--r-- | include/text.php | 2 |
3 files changed, 21 insertions, 10 deletions
diff --git a/include/connections.php b/include/connections.php index 936fc1edd..2a186192d 100644 --- a/include/connections.php +++ b/include/connections.php @@ -384,7 +384,7 @@ function contact_remove($channel_id, $abook_id) { dbesc($abook['abook_xchan']) ); - if ($xchan && strpos($xchan['xchan_addr'],'guest:') === 0 && strpos($abook['abook_xchan'],'.')){ + if ($xchan && strpos($xchan[0]['xchan_addr'],'guest:') === 0 && strpos($abook['abook_xchan'],'.')){ $atoken_guid = substr($abook['abook_xchan'],strrpos($abook['abook_xchan'],'.') + 1); if ($atoken_guid) { atoken_delete_and_sync($channel_id,$atoken_guid); diff --git a/include/event.php b/include/event.php index 0805bd2fe..7c81d6934 100644 --- a/include/event.php +++ b/include/event.php @@ -503,11 +503,22 @@ function ev_compare($a, $b) { function event_store_event($arr) { - $arr['created'] = (($arr['created']) ? $arr['created'] : datetime_convert()); - $arr['edited'] = (($arr['edited']) ? $arr['edited'] : datetime_convert()); - $arr['etype'] = (($arr['etype']) ? $arr['etype'] : 'event' ); - $arr['event_xchan'] = (($arr['event_xchan']) ? $arr['event_xchan'] : ''); - $arr['event_priority'] = (($arr['event_priority']) ? $arr['event_priority'] : 0); + $arr['created'] = $arr['created'] ?? datetime_convert(); + $arr['edited'] = $arr['edited'] ?? datetime_convert(); + $arr['etype'] = $arr['etype'] ?? 'event'; + $arr['event_xchan'] = $arr['event_xchan'] ?? ''; + $arr['event_priority'] = $arr['event_priority'] ?? 0; + $arr['location'] = $arr['location'] ?? ''; + $arr['nofinish'] = $arr['nofinish'] ?? 0; + $arr['event_status'] = $arr['event_status'] ?? ''; + $arr['event_percent'] = $arr['event_percent'] ?? 0; + $arr['event_repeat'] = $arr['event_repeat'] ?? ''; + $arr['event_sequence'] = $arr['event_sequence'] ?? 0; + $arr['event_vdata'] = $arr['event_vdata'] ?? ''; + $arr['allow_cid'] = $arr['allow_cid'] ?? ''; + $arr['allow_gid'] = $arr['allow_gid'] ?? ''; + $arr['deny_cid'] = $arr['deny_cid'] ?? ''; + $arr['deny_gid'] = $arr['deny_gid'] ?? ''; if (! $arr['dtend']) { $arr['dtend'] = NULL_DATE; @@ -522,7 +533,7 @@ function event_store_event($arr) { $existing_event = null; - if($arr['event_hash']) { + if(isset($arr['event_hash'])) { $r = q("SELECT * FROM event WHERE event_hash = '%s' AND uid = %d LIMIT 1", dbesc($arr['event_hash']), intval($arr['uid']) @@ -532,7 +543,7 @@ function event_store_event($arr) { } } - if($arr['id']) { + if(isset($arr['id'])) { $r = q("SELECT * FROM event WHERE id = %d AND uid = %d LIMIT 1", intval($arr['id']), intval($arr['uid']) @@ -1169,7 +1180,7 @@ function event_store_item($arr, $event) { $item = null; - if($arr['mid'] && $arr['uid']) { + if(isset($arr['mid'], $arr['uid'])) { $i = q("select * from item where mid = '%s' and uid = %d limit 1", dbesc($arr['mid']), intval($arr['uid']) diff --git a/include/text.php b/include/text.php index 2bcbdd1c0..af6ad7ea2 100644 --- a/include/text.php +++ b/include/text.php @@ -1892,8 +1892,8 @@ function format_poll($item,$s,$opts) { return EMPTY_STR; } + $closed = false; $commentable = can_comment_on_post(((local_channel()) ? get_observer_hash() : EMPTY_STR), $item); - $activated = ((local_channel() && local_channel() == $item['uid'] && get_observer_hash() !== $item['owner_xchan']) ? true : false); $output = $s; |