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.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/sabre/vobject/lib/Parser/MimeDir.php b/vendor/sabre/vobject/lib/Parser/MimeDir.php
index 10dcec89c..26a7101e5 100644
--- a/vendor/sabre/vobject/lib/Parser/MimeDir.php
+++ b/vendor/sabre/vobject/lib/Parser/MimeDir.php
@@ -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) {
@@ -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