From 34bcea81598e322251680d01ebcaaac720aaaf4b Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Mon, 16 Jun 2014 15:39:10 +0800 Subject: [PATCH] MDL-44124 libraries: Allow rrules with only one part during rrule validation checks --- lib/bennu/iCalendar_rfc2445.php | 4 ++-- lib/bennu/readme_moodle.txt | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/bennu/iCalendar_rfc2445.php b/lib/bennu/iCalendar_rfc2445.php index d221217c610..53fdd8adf53 100644 --- a/lib/bennu/iCalendar_rfc2445.php +++ b/lib/bennu/iCalendar_rfc2445.php @@ -398,8 +398,8 @@ function rfc2445_is_valid_value($value, $type) { $parts = explode(';', strtoupper($value)); - // First of all, we need at least a FREQ and a UNTIL or COUNT part, so... - if(count($parts) < 2) { + // We need at least one part for a valid rule, for example: "FREQ=DAILY". + if(empty($parts)) { return false; } diff --git a/lib/bennu/readme_moodle.txt b/lib/bennu/readme_moodle.txt index ce650557c26..783f27e408a 100644 --- a/lib/bennu/readme_moodle.txt +++ b/lib/bennu/readme_moodle.txt @@ -3,4 +3,5 @@ Description of Bennu library import - customised library by author, this version modifications: 1/ removed ereg functions deprecated as of php 5.3 (18 Nov 2009) 2/ replaced mbstring functions with moodle core_text (28 Nov 2011) -3/ replaced explode in iCalendar_component::unserialize() with preg_split to support various line breaks (20 Nov 2012) \ No newline at end of file +3/ replaced explode in iCalendar_component::unserialize() with preg_split to support various line breaks (20 Nov 2012) +4/ updated rfc2445_is_valid_value() to accept single part rrule as a valid value (16 Jun 2014)