From 366e3dfaaf232f1b8430d9069137445adfe529ca Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Tue, 20 Nov 2012 11:33:29 +0800 Subject: [PATCH] MDL-36592 calendar: Parse all line endings Conflicts: lib/bennu/iCalendar_components.php --- lib/bennu/iCalendar_components.php | 2 +- lib/bennu/readme_moodle.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bennu/iCalendar_components.php b/lib/bennu/iCalendar_components.php index 3c2936b1a22..1f6bf3da326 100644 --- a/lib/bennu/iCalendar_components.php +++ b/lib/bennu/iCalendar_components.php @@ -232,7 +232,7 @@ class iCalendar_component { function unserialize($string) { $string = rfc2445_unfold($string); // Unfold any long lines - $lines = explode(RFC2445_CRLF, $string); // Create an array of lines + $lines = preg_split("<".RFC2445_CRLF."|\n|\r>", $string, 0, PREG_SPLIT_NO_EMPTY); // Create an array of lines. $components = array(); // Initialise a stack of components $this->clear_errors(); diff --git a/lib/bennu/readme_moodle.txt b/lib/bennu/readme_moodle.txt index 1c6154b12ee..582b265fde7 100644 --- a/lib/bennu/readme_moodle.txt +++ b/lib/bennu/readme_moodle.txt @@ -2,4 +2,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 textlib (28 Nov 2011) \ No newline at end of file +2/ replaced mbstring functions with moodle textlib (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