diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-01-18 10:09:16 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-01-18 10:09:16 +0100 |
commit | d355e57fa63fd57867016a276450e7799ccabf65 (patch) | |
tree | 6e835f26af27c66dcd42a6721a4f8fe131fdfa65 /include | |
parent | f2d7c4091a4b7b5a3fdb066194c0354612574cfe (diff) | |
parent | 52305ca91b49f8a8f0380234879ac4e5be1705fb (diff) | |
download | volse-hubzilla-d355e57fa63fd57867016a276450e7799ccabf65.tar.gz volse-hubzilla-d355e57fa63fd57867016a276450e7799ccabf65.tar.bz2 volse-hubzilla-d355e57fa63fd57867016a276450e7799ccabf65.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include')
-rw-r--r-- | include/event.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/event.php b/include/event.php index a34250e7a..fdb9e1415 100644 --- a/include/event.php +++ b/include/event.php @@ -6,6 +6,10 @@ use Sabre\VObject; +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; + + require_once('include/bbcode.php'); /** @@ -463,8 +467,13 @@ function event_store_event($arr) { $hash = $arr['external_id']; elseif(array_key_exists('event_hash',$arr)) $hash = $arr['event_hash']; - else - $hash = random_string() . '@' . App::get_hostname(); + else { + try { + $hash = Uuid::uuid4()->toString(); + } catch (UnsatisfiedDependencyException $e) { + $hash = random_string(48); + } + } $r = q("INSERT INTO event ( uid,aid,event_xchan,event_hash,created,edited,dtstart,dtend,summary,description,location,etype, adjust,nofinish, event_status, event_status_date, event_percent, event_repeat, event_sequence, event_priority, event_vdata, allow_cid,allow_gid,deny_cid,deny_gid) @@ -1126,8 +1135,8 @@ function event_store_item($arr, $event) { } if(! $arr['mid']) { - $arr['uuid'] = item_message_id(); - $arr['mid'] = z_root() . '/item/' . $arr['uuid']; + $arr['uuid'] = $event['event_hash']; + $arr['mid'] = z_root() . '/event/' . $event['event_hash']; } $item_arr['aid'] = $z[0]['channel_account_id']; |