mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-03-14 12:23:33 +00:00
fix(#203): add iCal workaround where if ORGANIZER has no parameters
Some checks failed
tests / ci (push) Has been cancelled
Some checks failed
tests / ci (push) Has been cancelled
This commit is contained in:
parent
5ca028b885
commit
7301cac8ca
2 changed files with 169 additions and 1 deletions
|
|
@ -25,7 +25,12 @@ class IcalResponseParser implements ResponseParser
|
|||
}
|
||||
|
||||
try {
|
||||
$this->parser->parseString($body);
|
||||
// Workaround for om/icalparser v4.0.0 bug where it fails if ORGANIZER or ATTENDEE has no parameters.
|
||||
// When ORGANIZER or ATTENDEE has no parameters (no semicolon after the key),
|
||||
// IcalParser::parseRow returns an empty string for $middle instead of an array,
|
||||
// which causes a type error in a foreach loop in IcalParser::parseString.
|
||||
$normalizedBody = preg_replace('/^(ORGANIZER|ATTENDEE):/m', '$1;CN=Unknown:', $body);
|
||||
$this->parser->parseString($normalizedBody);
|
||||
|
||||
$events = $this->parser->getEvents()->sorted()->getArrayCopy();
|
||||
$windowStart = now()->subDays(7);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue