Просмотр исходного кода

Fix new lines when adding an event.

Julio Montoya 9 лет назад
Родитель
Сommit
30af87dcb7
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      main/inc/lib/agenda.lib.php

+ 6 - 1
main/inc/lib/agenda.lib.php

@@ -135,8 +135,9 @@ class Agenda
         $start = api_get_utc_datetime($start);
         $end = api_get_utc_datetime($end);
         $allDay = isset($allDay) && $allDay == 'true' ? 1 : 0;
-
         $id = null;
+        $content = nl2br($content);
+
         switch ($this->type) {
             case 'personal':
                 $attributes = array(
@@ -1743,6 +1744,10 @@ class Agenda
             $url = api_get_self().'?action='.$action.'&id='.$id.'&type='.$this->type;
         }
 
+        if (isset($params['content'])) {
+            $params['content'] = nl2br($params['content']);
+        }
+
         $form = new FormValidator(
             'add_event',
             'post',