From 7efefc6e63008b4b5005cc4ab22f02072393c2cc Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 5 Sep 2018 13:29:03 -0600 Subject: [PATCH] Strip UTF-8 BOM from ical file --- api/src/CalDAV/IcalIterator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/CalDAV/IcalIterator.php b/api/src/CalDAV/IcalIterator.php index bd3cd187b9..b072be9db4 100644 --- a/api/src/CalDAV/IcalIterator.php +++ b/api/src/CalDAV/IcalIterator.php @@ -161,7 +161,7 @@ class IcalIterator extends Horde_Icalendar implements \Iterator } else { - $line = fgets($this->ical_file); + $line = ltrim(fgets($this->ical_file), "\xef\xbb\xbf"); } // check if end of container reached if ($this->container && $line && substr($line,0,4+strlen($this->base)) === 'END:'.$this->base) @@ -229,6 +229,7 @@ class IcalIterator extends Horde_Icalendar implements \Iterator while (($line = $this->read_line()) && substr($line,0,6) !== 'BEGIN:') { + error_log("'".$line."'"); // ignore it } if ($line === false) // end-of-file or end-of-container