diff options
author | zotlabs <mike@macgirvin.com> | 2016-10-19 06:37:39 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-19 06:37:39 +1100 |
commit | 2e1046220a70bb751c39854b881e86feb5d39149 (patch) | |
tree | ed43b874f5519cf06a05a703e144fd6acad06d4b /vendor/sabre/vobject/lib/Property/ICalendar | |
parent | 17091bd38c4e4e5d8b1812dd1d9efeffe0046d02 (diff) | |
parent | 745515b11f438d3658203aaaaf151c72e30d5e7c (diff) | |
download | volse-hubzilla-2e1046220a70bb751c39854b881e86feb5d39149.tar.gz volse-hubzilla-2e1046220a70bb751c39854b881e86feb5d39149.tar.bz2 volse-hubzilla-2e1046220a70bb751c39854b881e86feb5d39149.zip |
Merge pull request #554 from dawnbreak/composer-light
[FEATURE] Add config and use composer autoloader.
Diffstat (limited to 'vendor/sabre/vobject/lib/Property/ICalendar')
-rw-r--r-- | vendor/sabre/vobject/lib/Property/ICalendar/Recur.php | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php index a3c36dc64..8392a5cc1 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php @@ -260,21 +260,39 @@ class Recur extends Property { foreach ($values as $key => $value) { - if (empty($value)) { + if ($value === '') { $warnings[] = [ - 'level' => $repair ? 3 : 1, + 'level' => $repair ? 1 : 3, 'message' => 'Invalid value for ' . $key . ' in ' . $this->name, 'node' => $this ]; if ($repair) { unset($values[$key]); } + } elseif ($key == 'BYMONTH') { + $byMonth = (array)$value; + foreach ($byMonth as $i => $v) { + if (!is_numeric($v) || (int)$v < 1 || (int)$v > 12) { + $warnings[] = [ + 'level' => $repair ? 1 : 3, + 'message' => 'BYMONTH in RRULE must have value(s) between 1 and 12!', + 'node' => $this + ]; + if ($repair) { + if (is_array($value)) { + unset($values[$key][$i]); + } else { + unset($values[$key]); + } + } + } + } } } if (!isset($values['FREQ'])) { $warnings[] = [ - 'level' => $repair ? 3 : 1, + 'level' => $repair ? 1 : 3, 'message' => 'FREQ is required in ' . $this->name, 'node' => $this ]; |