aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Parser/MimeDir.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/vobject/lib/Parser/MimeDir.php')
-rw-r--r--vendor/sabre/vobject/lib/Parser/MimeDir.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/vendor/sabre/vobject/lib/Parser/MimeDir.php b/vendor/sabre/vobject/lib/Parser/MimeDir.php
index 10dcec89c..ea5ac0326 100644
--- a/vendor/sabre/vobject/lib/Parser/MimeDir.php
+++ b/vendor/sabre/vobject/lib/Parser/MimeDir.php
@@ -124,7 +124,7 @@ class MimeDir extends Parser
$this->startLine = 0;
if (is_string($input)) {
- // Convering to a stream.
+ // Converting to a stream.
$stream = fopen('php://temp', 'r+');
fwrite($stream, $input);
rewind($stream);
@@ -195,6 +195,9 @@ class MimeDir extends Parser
{
// Start of a new component
if ('BEGIN:' === strtoupper(substr($line, 0, 6))) {
+ if (substr($line, 6) === $this->root->name) {
+ throw new ParseException('Invalid MimeDir file. Unexpected component: "'.$line.'" in document type '.$this->root->name);
+ }
$component = $this->root->createComponent(substr($line, 6), [], false);
while (true) {
@@ -477,7 +480,7 @@ class MimeDir extends Parser
* vCard 3.0 says:
* * (rfc2425) Backslashes, newlines (\n or \N) and comma's must be
* escaped, all time time.
- * * Comma's are used for delimeters in multiple values
+ * * Comma's are used for delimiters in multiple values
* * (rfc2426) Adds to to this that the semi-colon MUST also be escaped,
* as in some properties semi-colon is used for separators.
* * Properties using semi-colons: N, ADR, GEO, ORG
@@ -655,7 +658,7 @@ class MimeDir extends Parser
// missing a whitespace. So if 'forgiving' is turned on, we will take
// those as well.
if ($this->options & self::OPTION_FORGIVING) {
- while ('=' === substr($value, -1)) {
+ while ('=' === substr($value, -1) && $this->lineBuffer) {
// Reading the line
$this->readLine();
// Grabbing the raw form