diff --git a/api/src/Etemplate/Widget/Description.php b/api/src/Etemplate/Widget/Description.php index f77b959a84..338e80f15d 100644 --- a/api/src/Etemplate/Widget/Description.php +++ b/api/src/Etemplate/Widget/Description.php @@ -28,4 +28,28 @@ class Description extends Etemplate\Widget * @var string|array */ protected $legacy_options = 'bold-italic,link,activate_links,label_for,link_target,link_popup_size,link_title'; + + /** + * Set up what we know on the server side. + * + * Encode html specialchars (eg. < to <) because client-side core + * widget runs decoding for the value causes elimination of none + * encoded html chars. This will help included links inside description + * get displayed if activate_links = ture for description widget is set. + * + * @param string $cname + * @param array $expand values for keys 'c', 'row', 'c_', 'row_', 'cont' + */ + public function beforeSendToClient($cname, array $expand=null) + { + if ($this->attrs['activate_links']) + { + $form_name = self::form_name($cname, $this->id, $expand); + $value =& self::get_array(self::$request->content, $form_name); + if (!empty($value)) + { + $value = htmlspecialchars($value); + } + } + } } diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 150806c0ba..f8fbc24e18 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -1936,13 +1936,6 @@ class calendar_uiforms extends calendar_ui } $event = array_shift($events); - /* Encode html specialchars (eg. < to <) because client-side core - * widget runs decoding for the value causes elimination of none - * encoded html chars. This will help included links inside description - * get displayed if activate_links = ture for description widget is set. - */ - if ($event['description'] != '') $event['description'] = htmlspecialchars($event['description']); - // convert event from servertime returned by calendar_ical to user-time $this->bo->server2usertime($event);