X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FEvent.php;h=992b77badabaf8042907aae3df0b7d5af4eb0353;hb=0bc2fe66f54717a3f2e86fd9626dc565e9d00fd7;hp=1bc922b4653ab73144d0ecc52f95a73ab0468841;hpb=c72c64a6d82063877e7f3013428ddef0dd44fd1b;p=friendica.git diff --git a/src/Model/Event.php b/src/Model/Event.php index 1bc922b465..992b77bada 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -62,7 +62,7 @@ class Event extends BaseObject $o .= "
" . $event_end . "
"; } - if (strlen($event['location'])) { + if (!empty($event['location'])) { $o .= "" . BBCode::convert($event['location'], false, $simple) . "
"; } @@ -550,10 +550,13 @@ class Event extends BaseObject $fmt = L10n::t('l, F j'); foreach ($event_result as $event) { $item = Item::selectFirst(['plink', 'author-name', 'author-avatar', 'author-link'], ['id' => $event['itemid']]); - if (DBA::isResult($item)) { - $event = array_merge($event, $item); + if (!DBA::isResult($item)) { + // Using default values when no item had been found + $item = ['plink' => '', 'author-name' => '', 'author-avatar' => '', 'author-link' => '']; } + $event = array_merge($event, $item); + $start = $event['adjust'] ? DateTimeFormat::local($event['start'], 'c') : DateTimeFormat::utc($event['start'], 'c'); $j = $event['adjust'] ? DateTimeFormat::local($event['start'], 'j') : DateTimeFormat::utc($event['start'], 'j'); $day = $event['adjust'] ? DateTimeFormat::local($event['start'], $fmt) : DateTimeFormat::utc($event['start'], $fmt);