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
This commit is contained in:
nathangray 2020-04-06 10:54:46 -06:00
parent 818d62ba5e
commit b1cb9c10ef

View File

@ -227,7 +227,7 @@ class IcalIterator extends Horde_Icalendar implements \Iterator
{ {
unset($this->component); 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."'"); error_log("'".$line."'");
// ignore it // ignore it
@ -242,7 +242,7 @@ class IcalIterator extends Horde_Icalendar implements \Iterator
//error_log(__METHOD__."() found $type component"); //error_log(__METHOD__."() found $type component");
$data = $line; $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; $data .= $line;
} }