Remove private key from event array in Event::store

This commit is contained in:
Hypolite Petovan 2018-03-17 00:32:08 -04:00
parent 4eaf0d76b0
commit 89e9cbb0b5
2 changed files with 6 additions and 6 deletions

View File

@ -170,7 +170,7 @@ function events_post(App $a) {
$datarray['allow_gid'] = $str_group_allow;
$datarray['deny_cid'] = $str_contact_deny;
$datarray['deny_gid'] = $str_group_deny;
$datarray['private'] = (($private_event) ? 1 : 0);
$datarray['private'] = $private_event;
$datarray['id'] = $event_id;
if (intval($_REQUEST['preview'])) {

View File

@ -223,17 +223,17 @@ class Event extends BaseObject
*
* Store the event in the event table and create an event item in the item table.
*
* @param array $event Array with event data.
* @return int The event id.
* @param array $arr Array with event data.
* @return int The new event id.
*/
public static function store($arr)
{
$a = self::getApp();
$event['uri'] = defaults($arr, 'uri' , item_new_uri($a->get_hostname(), $event['uid']));
$event['id'] = intval(defaults($arr, 'id' , 0));
$event['uid'] = intval(defaults($arr, 'uid' , 0));
$event['cid'] = intval(defaults($arr, 'cid' , 0));
$event['uri'] = defaults($arr, 'uri' , item_new_uri($a->get_hostname(), $event['uid']));
$event['type'] = defaults($arr, 'type' , 'event');
$event['summary'] = defaults($arr, 'summary' , '');
$event['desc'] = defaults($arr, 'desc' , '');
@ -242,7 +242,6 @@ class Event extends BaseObject
$event['allow_gid'] = defaults($arr, 'allow_gid', '');
$event['deny_cid'] = defaults($arr, 'deny_cid' , '');
$event['deny_gid'] = defaults($arr, 'deny_gid' , '');
$event['private'] = intval(defaults($arr, 'private' , 0));
$event['adjust'] = intval(defaults($arr, 'adjust' , 0));
$event['nofinish'] = intval(defaults($arr, 'nofinish' , !empty($event['start']) && empty($event['finish'])));
@ -253,6 +252,7 @@ class Event extends BaseObject
if ($event['finish'] < NULL_DATE) {
$event['finish'] = NULL_DATE;
}
$private = intval(defaults($arr, 'private', 0));
$condition = ['uid' => $event['uid']];
if ($event['cid']) {
@ -330,7 +330,7 @@ class Event extends BaseObject
$item_arr['allow_gid'] = $event['allow_gid'];
$item_arr['deny_cid'] = $event['deny_cid'];
$item_arr['deny_gid'] = $event['deny_gid'];
$item_arr['private'] = $event['private'];
$item_arr['private'] = $private;
$item_arr['visible'] = 1;
$item_arr['verb'] = ACTIVITY_POST;
$item_arr['object-type'] = ACTIVITY_OBJ_EVENT;