]> git.mxchange.org Git - friendica.git/blobdiff - include/event.php
Merge branch 'master' of https://github.com/friendica/friendica
[friendica.git] / include / event.php
old mode 100644 (file)
new mode 100755 (executable)
index 99f685d..29202ba
@@ -53,7 +53,12 @@ function parse_event($h) {
 
        $ret = array();
 
-       $dom = HTML5_Parser::parse($h);
+
+       try {
+               $dom = HTML5_Parser::parse($h);
+       } catch (DOMException $e) {
+               logger('parse_event: parse error: ' . $e);
+       }
 
        if(! $dom)
                return $ret;
@@ -158,7 +163,7 @@ function bbtoevent($s) {
        if(preg_match("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",$s,$match))
                $ev['adjust'] = $match[1];
        $match = '';
-       $ev['nofinish'] = (($ev['start'] && (! $ev['finish'])) ? 1 : 0);
+       $ev['nofinish'] = (((x($ev, 'start') && $ev['start']) && (!x($ev, 'finish') || !$ev['finish'])) ? 1 : 0);
        return $ev;
 
 }
@@ -352,7 +357,7 @@ function event_store($arr) {
                $item_arr['visible']       = 1;
                $item_arr['verb']          = ACTIVITY_POST;
                $item_arr['object-type']   = ACTIVITY_OBJ_EVENT;
-
+               $item_arr['origin']        = ((intval($arr['cid']) == 0) ? 1 : 0);
                $item_arr['body']          = format_event_bbcode($event);