From 0cd4c3410121b9b584dc1b108e555832843b2576 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 15 Feb 2021 18:35:40 +0000 Subject: compser update sabre/dav /vobject --- vendor/sabre/vobject/lib/Recur/RRuleIterator.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'vendor/sabre/vobject/lib/Recur/RRuleIterator.php') diff --git a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php index 55581e9ac..0511f0ade 100644 --- a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php +++ b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php @@ -468,6 +468,13 @@ class RRuleIterator implements Iterator // beginning. $currentDayOfMonth = 0; + // For some reason the "until" parameter was not being used here, + // that's why the workaround of the 10000 year bug was needed at all + // let's stop it before the "until" parameter date + if ($this->until && $this->currentDate->getTimestamp() >= $this->until->getTimestamp()) { + return; + } + // To prevent running this forever (better: until we hit the max date of DateTimeImmutable) we simply // stop at 9999-12-31. Looks like the year 10000 problem is not solved in php .... if ($this->currentDate->getTimestamp() > 253402300799) { @@ -536,7 +543,7 @@ class RRuleIterator implements Iterator foreach ($this->byWeekNo as $byWeekNo) { foreach ($dayOffsets as $dayOffset) { $date = clone $this->currentDate; - $date->setISODate($currentYear, $byWeekNo, $dayOffset); + $date = $date->setISODate($currentYear, $byWeekNo, $dayOffset); if ($date > $this->currentDate) { $checkDates[] = $date; @@ -717,7 +724,6 @@ class RRuleIterator implements Iterator break; case 'INTERVAL': - case 'COUNT': $val = (int) $value; if ($val < 1) { @@ -877,7 +883,7 @@ class RRuleIterator implements Iterator foreach ($this->byMonthDay as $monthDay) { // Removing values that are out of range for this month if ($monthDay > $startDate->format('t') || - $monthDay < 0 - $startDate->format('t')) { + $monthDay < 0 - $startDate->format('t')) { continue; } if ($monthDay > 0) { -- cgit v1.2.3