Permalink
Browse files

MDL-36592 calendar: Parse all line endings

Conflicts:

	lib/bennu/iCalendar_components.php
  • Loading branch information...
1 parent 2d7c5ee commit 366e3dfaaf232f1b8430d9069137445adfe529ca @ankitagarwal ankitagarwal committed Nov 20, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 lib/bennu/iCalendar_components.php
  2. +2 −1 lib/bennu/readme_moodle.txt
@@ -232,7 +232,7 @@ function serialize() {
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();
@@ -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)
+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)

0 comments on commit 366e3df

Please sign in to comment.