Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions vendor/sabre/vobject/lib/Parser/MimeDir.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class MimeDir extends Parser
'Windows-1252',
];

protected $stderr;

/**
* Parses an iCalendar or vCard file.
*
Expand Down Expand Up @@ -165,9 +167,40 @@ protected function parseDocument()

$this->root = new $class([], false);

if (!$this->stderr) {
$this->stderr = fopen('php://stderr', 'w');
}

$card = "";
$startnote = false;
$pattern = "/^[A-Z;=]+:/";
while (true) {
// Reading until we hit END:
$line = $this->readLine();
// fwrite($this->stderr, "line = $line \n");
$card = $card . $line . "\n";
if ('NOTE:' === strtoupper(substr($line, 0, 5))) {
// fwrite($this->stderr, "is note \n");
$startnote = true;
$note = $line;
continue;
}
if ($startnote) {
// fwrite($this->stderr, "is startnote \n");
if (preg_match($pattern, $line)) {
// fwrite($this->stderr, "is new property line after note \n");
// fwrite($this->stderr, "note = " . $note . "\n");
$result = $this->parseLine($note);
if ($result) {
$this->root->add($result);
}
} else {
// fwrite($this->stderr, "is just line after note \n");
// $note = $note . "=0D=0A" . $line;
$note = $note . '\n' . $line;
continue;
}
}
if ('END:' === strtoupper(substr($line, 0, 4))) {
break;
}
Expand Down