Lines Matching +full:security +full:- +full:events
5 * Copyright (C) 2010-2012, 2015-2016
6 * Tim Ruffing, Robert Rackl, Elan Ruusamäe, Jannes Drost-Tenfelde
22 * not, see <http://www.gnu.org/licenses/gpl-2.0.html>.
24 * @license https://www.gnu.org/licenses/gpl-2.0.html GPL2
28 * @author Jannes Drost-Tenfelde <info@drost-tenfelde.de>
47 $this->nonce = mt_rand();
48 $this->localTimezone = new DateTimeZone(date_default_timezone_get());
57 $match = substr($match, strpos($match, '>') + 1, -2);
61 // parse_str urldecodes valid percent-encoded byte, e.g., %dd.
89 $template = $this->getConf('template:' . $showAs);
91 $template = $this->getConf('default');
97 $order = -1;
155 … $renderer->doc .= static::ERROR_PREFIX . 'invalid date/time string: '. $e->getMessage() . '.';
162 $renderer->doc .= static::ERROR_PREFIX . $e->getMessage() . ' ';
166 // SECURITY
173 $renderer->info['cache'] = false;
179 $renderer->doc .= static::ERROR_PREFIX . 'invalid iCalendar input. ';
186 $recurrenceId = rawurldecode($_GET['recurrence-id']);
188 // Make sure the sub-event is in the expanded calendar.
192 // +/- 1 day to avoid time zone weirdness
193 … $ical = $ical->expand($dtRecurrence->modify('-1 day'), $dtRecurrence->modify('+1 day'));
195 … $renderer->doc .= static::ERROR_PREFIX . 'Unable to expand recurrent events for export.';
200 $comp = array_shift(array_filter($ical->getByUid($uid),
202 return ((string) $event->{'RECURRENCE-ID'}) === $recurrenceId;
206 $renderer->doc .= $comp->serialize();
207 $eid = $uid . ($recurrenceId ? '-' . $recurrenceId : '');
208 $renderer->setEventId($eid);
217 $dateFormat = $dformat ?: $this->getConf('dformat') ?: '%Y/%m/%d';
218 $timeFormat = $tformat ?: $this->getConf('tformat') ?: '%H:%M';
221 $vevent = $ical->expand($from, $to)->VEVENT;
224 $renderer->doc .= static::ERROR_PREFIX . 'unable to expand recurrent events. ';
229 // No events, nothing to do.
233 $events = $vevent->getIterator();
237 $events->uasort(
239 $diff = $e1->DTSTART->getDateTime($this->localTimezone)->getTimestamp()
240 - $e2->DTSTART->getDateTime($this->localTimezone)->getTimestamp();
246 // Loop over events and render template for each one.
249 foreach ($events as &$event) {
255 … = $this->renderEvent($mode, $renderer, $event, $template, $dateFormat, $timeFormat);
261 $summaryLinkToken= '{summary_link:' . $this->nonce . '}';
262 $rep = $this->nowikiStart() . $summaryLinkToken . $this->nowikiEnd();
272 …static::str_remove_deep(array($this->nowikiStart(), $this->nowikiEnd(), $this->magicString()), $in…
281 …$text = str_replace(array($this->nowikiStart(), $this->nowikiEnd(), $this->magicString()), '', $te…
293 …$renderer->doc = static::str_replace_array($summaryLinkToken , $summaryLinks, $linksPerEvent, $ren…
313 $template = str_replace('{description}', $this->textAsWiki($event->DESCRIPTION), $template);
316 $summary = $this->textAsWiki($event->SUMMARY);
320 $location = $event->LOCATION;
326 $locationUrl = $this->getLocationUrl($location);
337 $dt = $this->handleDatetime($event, $dateFormat, $timeFormat);
346 $whenString = $startString . ($endString ? ' - ' : '') . $endString;
355 $link['class'] = 'mediafile plugin-icalevents-export';
360 $link['title'] = hsc($event->SUMMARY);
362 'uid' => rawurlencode($event->UID),
363 'recurrence-id' => rawurlencode($event->{'RECURRENCE-ID'})
369 $summaryLink = '<span>' . $renderer->_formatLink($link) . '</span>';
371 $template = str_replace('{summary_link}', $event->SUMMARY, $template);
394 if (!$http->get($source)) {
395 $error = 'could not get ' . hsc($source) . ', HTTP status ' . $http->status . '. ';
398 return $http->resp_body;
406 // This does not work for protocol-relative URLs
416 $dtSabre = $event->{'DT' . strtoupper($which)};
417 $dtImmutable = $dtSabre->getDateTime($this->localTimezone);
419 // Correct end date for all-day events, which formally end
421 if (!$dtSabre->hasTime() && $which == 'end') {
422 $dtImmutable = $dtImmutable->modify('-1 day');
424 $dt['datestring'] = strftime($dateFormat, $dtImmutable->getTimestamp());
425 …$dt['timestring'] = $dtSabre->hasTime() ? strftime($timeFormat, $dtImmutable->getTimestamp()) : '';
441 $relTwoY = strtotime($str, time() - 2 * 365 * 24 * 3600);
497 // First, remove existing </nowiki> end tags. (We display events that contain '</nowiki>'
501 $haystack = array('', $this->nowikiEnd() . '\\\\ '. $this->nowikiStart());
503 return $this->nowikiStart() . $text . $this->nowikiEnd();
507 return '{' . $this->nonce .' magiccc}';
511 return '<nowiki>' . $this->magicString();
515 return $this->magicString() . '</nowiki>';
522 $prefix = $this->getConf('customLocationUrlPrefix') ?: $this->getConf('locationUrlPrefix');