From b1cb9c10efbfae5217a81931e1e9ba2a85f2d22d Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 6 Apr 2020 10:54:46 -0600 Subject: [PATCH] Case insensitive check for vCard BEGIN & END flags fixes lowercase vcards would not import https://tools.ietf.org/id/draft-ietf-vcarddav-vcardrev-02.html#anchor3 --- api/src/CalDAV/IcalIterator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/CalDAV/IcalIterator.php b/api/src/CalDAV/IcalIterator.php index b072be9db4..ba519fbbaf 100644 --- a/api/src/CalDAV/IcalIterator.php +++ b/api/src/CalDAV/IcalIterator.php @@ -227,7 +227,7 @@ class IcalIterator extends Horde_Icalendar implements \Iterator { unset($this->component); - while (($line = $this->read_line()) && substr($line,0,6) !== 'BEGIN:') + while (($line = $this->read_line()) && strcasecmp(substr($line,0,6), 'BEGIN:')!==0) { error_log("'".$line."'"); // ignore it @@ -242,7 +242,7 @@ class IcalIterator extends Horde_Icalendar implements \Iterator //error_log(__METHOD__."() found $type component"); $data = $line; - while (($line = $this->read_line()) && substr($line,0,4+strlen($type)) !== 'END:'.$type) + while (($line = $this->read_line()) && strcasecmp(substr($line,0,4+strlen($type)), 'END:'.$type) !== 0) { $data .= $line; }