X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fevent.php;h=29202baddf982417cdf3decedc3f0b69be539dc8;hb=19eaed60d57e0db936b4161d1976243cb322efc2;hp=99f685d0bd9f2021c5ef39380c5a93453b460d2c;hpb=bdf42473a0341f291cd256323d122aa80bb0cb0b;p=friendica.git diff --git a/include/event.php b/include/event.php old mode 100644 new mode 100755 index 99f685d0bd..29202baddf --- a/include/event.php +++ b/include/event.php @@ -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);