aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Recur
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-01-09 13:34:37 +0000
committerMario <mario@mariovavti.com>2020-01-09 13:34:37 +0000
commit537a7cf03d6ee86465f8aca761653606741d3658 (patch)
tree61a961105de3f4f37bf6159e79c77b0780b5f8bc /vendor/sabre/vobject/lib/Recur
parent662e8f8a4c67e9a7de579ff93f4c36ae2006e186 (diff)
downloadvolse-hubzilla-537a7cf03d6ee86465f8aca761653606741d3658.tar.gz
volse-hubzilla-537a7cf03d6ee86465f8aca761653606741d3658.tar.bz2
volse-hubzilla-537a7cf03d6ee86465f8aca761653606741d3658.zip
composer updates
Diffstat (limited to 'vendor/sabre/vobject/lib/Recur')
-rw-r--r--vendor/sabre/vobject/lib/Recur/RRuleIterator.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php
index 554507f19..75342a2a8 100644
--- a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php
+++ b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php
@@ -67,6 +67,9 @@ class RRuleIterator implements Iterator
*/
public function valid()
{
+ if (null === $this->currentDate) {
+ return false;
+ }
if (!is_null($this->count)) {
return $this->counter < $this->count;
}
@@ -338,7 +341,7 @@ class RRuleIterator implements Iterator
if ($this->byHour) {
if ('23' == $this->currentDate->format('G')) {
// to obey the interval rule
- $this->currentDate = $this->currentDate->modify('+'.$this->interval - 1 .' days');
+ $this->currentDate = $this->currentDate->modify('+'.($this->interval - 1).' days');
}
$this->currentDate = $this->currentDate->modify('+1 hours');
@@ -398,7 +401,7 @@ class RRuleIterator implements Iterator
// We need to roll over to the next week
if ($currentDay === $firstDay && (!$this->byHour || '0' == $currentHour)) {
- $this->currentDate = $this->currentDate->modify('+'.$this->interval - 1 .' weeks');
+ $this->currentDate = $this->currentDate->modify('+'.($this->interval - 1).' weeks');
// We need to go to the first day of this week, but only if we
// are not already on this first day of this week.
@@ -461,6 +464,14 @@ class RRuleIterator implements Iterator
// This goes to 0 because we need to start counting at the
// beginning.
$currentDayOfMonth = 0;
+
+ // 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) {
+ $this->currentDate = null;
+
+ return;
+ }
}
$this->currentDate = $this->currentDate->setDate(