diff options
author | Mario <mario@mariovavti.com> | 2022-10-11 18:29:06 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-10-11 18:29:06 +0000 |
commit | ccd826f63a7a4c7e442fab8a70d9c4c84808b417 (patch) | |
tree | fbbde69114acba764cf6b735433c53e099fd19c5 /vendor/sabre/vobject/lib/Recur | |
parent | 5e5f0aa955d86743a14531bed98501b59140ab1f (diff) | |
download | volse-hubzilla-ccd826f63a7a4c7e442fab8a70d9c4c84808b417.tar.gz volse-hubzilla-ccd826f63a7a4c7e442fab8a70d9c4c84808b417.tar.bz2 volse-hubzilla-ccd826f63a7a4c7e442fab8a70d9c4c84808b417.zip |
Revert "update composer libs"
This reverts commit 5e5f0aa955d86743a14531bed98501b59140ab1f.
Diffstat (limited to 'vendor/sabre/vobject/lib/Recur')
-rw-r--r-- | vendor/sabre/vobject/lib/Recur/RRuleIterator.php | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php index 4f0e9070d..d556aa6c3 100644 --- a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php +++ b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php @@ -25,13 +25,6 @@ use Sabre\VObject\Property; class RRuleIterator implements Iterator { /** - * Constant denoting the upper limit on how long into the future - * we want to iterate. The value is a unix timestamp and currently - * corresponds to the datetime 9999-12-31 11:59:59 UTC. - */ - const dateUpperLimit = 253402300799; - - /** * Creates the Iterator. * * @param string|array $rrule @@ -373,12 +366,6 @@ class RRuleIterator implements Iterator // Current hour of the day $currentHour = $this->currentDate->format('G'); - - if ($this->currentDate->getTimestamp() > self::dateUpperLimit) { - $this->currentDate = null; - - return; - } } while ( ($this->byDay && !in_array($currentDay, $recurrenceDays)) || ($this->byHour && !in_array($currentHour, $recurrenceHours)) || @@ -499,7 +486,7 @@ class RRuleIterator implements Iterator // 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() > self::dateUpperLimit) { + if ($this->currentDate->getTimestamp() > 253402300799) { $this->currentDate = null; return; @@ -602,12 +589,11 @@ class RRuleIterator implements Iterator // loop through all YearDay and Days to check all the combinations foreach ($this->byYearDay as $byYearDay) { $date = clone $this->currentDate; + $date = $date->setDate($currentYear, 1, 1); if ($byYearDay > 0) { - $date = $date->setDate($currentYear, 1, 1); - $date = $date->add(new \DateInterval('P'.($byYearDay - 1).'D')); + $date = $date->add(new \DateInterval('P'.$byYearDay.'D')); } else { - $date = $date->setDate($currentYear, 12, 31); - $date = $date->sub(new \DateInterval('P'.abs($byYearDay + 1).'D')); + $date = $date->sub(new \DateInterval('P'.abs($byYearDay).'D')); } if ($date > $this->currentDate && in_array($date->format('N'), $dayOffsets)) { @@ -672,14 +658,6 @@ class RRuleIterator implements Iterator (int) $currentMonth, (int) $currentDayOfMonth ); - - // 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() > self::dateUpperLimit) { - $this->currentDate = null; - - return; - } } // If we made it here, it means we got a valid occurrence |