From 1b89512c38239456eb07261f9c7607f2a6f04865 Mon Sep 17 00:00:00 2001 From: Joel Stein Date: Wed, 1 Feb 2023 17:40:47 -0600 Subject: [PATCH] Added support for comma-separated BYMONTHDAY value --- src/Property/Event/RecurrenceRule.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Property/Event/RecurrenceRule.php b/src/Property/Event/RecurrenceRule.php index a424d254..25f2526a 100644 --- a/src/Property/Event/RecurrenceRule.php +++ b/src/Property/Event/RecurrenceRule.php @@ -448,8 +448,10 @@ public function setByYearDay($day) */ public function setByMonthDay($day) { - if (!is_integer($day) || $day > 31 || $day < -31 || $day === 0) { - throw new InvalidArgumentException('Invalid value for BYMONTHDAY'); + foreach (explode(',', $day) as $value) { + if (!filter_var($value, FILTER_VALIDATE_INT, ['options' => ['min_range' => -31, 'max_range' => 31]]) || (int) $value === 0) { + throw new InvalidArgumentException('Invalid value for BYMONTHDAY'); + } } $this->byMonthDay = $day;