aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Property/ICalendar
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/vobject/lib/Property/ICalendar')
-rw-r--r--vendor/sabre/vobject/lib/Property/ICalendar/Duration.php2
-rw-r--r--vendor/sabre/vobject/lib/Property/ICalendar/Period.php2
-rw-r--r--vendor/sabre/vobject/lib/Property/ICalendar/Recur.php48
3 files changed, 50 insertions, 2 deletions
diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php b/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php
index 66d366960..7b7e1ce8e 100644
--- a/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php
+++ b/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php
@@ -2,8 +2,8 @@
namespace Sabre\VObject\Property\ICalendar;
-use Sabre\VObject\Property;
use Sabre\VObject\DateTimeParser;
+use Sabre\VObject\Property;
/**
* Duration property.
diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Period.php b/vendor/sabre/vobject/lib/Property/ICalendar/Period.php
index a4561d929..d35b425aa 100644
--- a/vendor/sabre/vobject/lib/Property/ICalendar/Period.php
+++ b/vendor/sabre/vobject/lib/Property/ICalendar/Period.php
@@ -2,8 +2,8 @@
namespace Sabre\VObject\Property\ICalendar;
-use Sabre\VObject\Property;
use Sabre\VObject\DateTimeParser;
+use Sabre\VObject\Property;
use Sabre\Xml;
/**
diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php
index 8392a5cc1..434b77088 100644
--- a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php
+++ b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php
@@ -287,6 +287,54 @@ class Recur extends Property {
}
}
}
+ // if there is no valid entry left, remove the whole value
+ if (is_array($value) && empty($values[$key])) {
+ unset($values[$key]);
+ }
+ } elseif ($key == 'BYWEEKNO') {
+ $byWeekNo = (array)$value;
+ foreach ($byWeekNo as $i => $v) {
+ if (!is_numeric($v) || (int)$v < -53 || (int)$v == 0 || (int)$v > 53) {
+ $warnings[] = [
+ 'level' => $repair ? 1 : 3,
+ 'message' => 'BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!',
+ 'node' => $this
+ ];
+ if ($repair) {
+ if (is_array($value)) {
+ unset($values[$key][$i]);
+ } else {
+ unset($values[$key]);
+ }
+ }
+ }
+ }
+ // if there is no valid entry left, remove the whole value
+ if (is_array($value) && empty($values[$key])) {
+ unset($values[$key]);
+ }
+ } elseif ($key == 'BYYEARDAY') {
+ $byYearDay = (array)$value;
+ foreach ($byYearDay as $i => $v) {
+ if (!is_numeric($v) || (int)$v < -366 || (int)$v == 0 || (int)$v > 366) {
+ $warnings[] = [
+ 'level' => $repair ? 1 : 3,
+ 'message' => 'BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!',
+ 'node' => $this
+ ];
+ if ($repair) {
+ if (is_array($value)) {
+ unset($values[$key][$i]);
+ } else {
+ unset($values[$key]);
+ }
+ }
+ }
+ }
+ // if there is no valid entry left, remove the whole value
+ if (is_array($value) && empty($values[$key])) {
+ unset($values[$key]);
+ }
}
}