Skip to content

Commit

Permalink
MDL-38485 calendar: Carry over line breaks on imports
Browse files Browse the repository at this point in the history
Thanks to Matthias Schwabe for the patch suggestion
  • Loading branch information
ankitagarwal committed Feb 19, 2015
1 parent 7357af2 commit 575e27f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2953,11 +2953,12 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
$description = '';
} else {
$description = $event->properties['DESCRIPTION'][0]->value;
$description = clean_param($description, PARAM_NOTAGS);
$description = str_replace('\n', '<br />', $description);
$description = str_replace('\\', '', $description);
$description = preg_replace('/\s+/', ' ', $description);
}
$eventrecord->description = clean_param($description, PARAM_NOTAGS);
$eventrecord->description = $description;

// Probably a repeating event with RRULE etc. TODO: skip for now.
if (empty($event->properties['DTSTART'][0]->value)) {
Expand Down

0 comments on commit 575e27f

Please sign in to comment.