MDL-65262 core_calendar: change location param type
authorSimey Lameze <simey@moodle.com>
Thu, 4 Apr 2019 23:17:51 +0000 (07:17 +0800)
committerSimey Lameze <simey@moodle.com>
Thu, 2 May 2019 03:29:42 +0000 (11:29 +0800)
calendar/classes/external/event_exporter_base.php
calendar/lib.php

index d20cfb3..3471a55 100644 (file)
@@ -125,7 +125,7 @@ class event_exporter_base extends exporter {
                 'null' => NULL_ALLOWED
             ],
             'location' => [
-                'type' => PARAM_RAW_TRIMMED,
+                'type' => PARAM_RAW,
                 'optional' => true,
                 'default' => null,
                 'null' => NULL_ALLOWED
index 6ef434f..02c2d97 100644 (file)
@@ -2849,7 +2849,7 @@ function calendar_add_icalendar_event($event, $unused = null, $subscriptionid, $
     }
 
     $eventrecord->location = empty($event->properties['LOCATION'][0]->value) ? '' :
-            str_replace('\\', '', $event->properties['LOCATION'][0]->value);
+            trim(str_replace('\\', '', $event->properties['LOCATION'][0]->value));
     $eventrecord->uuid = $event->properties['UID'][0]->value;
     $eventrecord->timemodified = time();