Trim comment and convert newline characters
authorJoey Schulze <joey@infodrom.org>
Mon, 20 May 2019 21:38:18 +0000 (23:38 +0200)
committerJoey Schulze <joey@infodrom.org>
Mon, 20 May 2019 21:38:18 +0000 (23:38 +0200)
class/calendar_item.class.php

index 2eeb005..822bd79 100644 (file)
@@ -132,7 +132,7 @@ class Calendar_Item extends DatabaseTable {
     $item = array('dav_id' => $this->id,
                  'name' => strlen($data['name']) ? $data['name'] : NULL,
                  'url' => strlen($data['url']) ? $data['url'] : NULL,
-                 'comment' => strlen($data['comment']) ? $data['comment'] : NULL,
+                 'comment' => strlen($data['comment']) ? nl2br(trim($data['comment'])) : NULL,
                  'sys_user' => $_SERVER['REMOTE_USER'],
                  'sys_edit' => 'now()');