Revert commit 8340520589 and implement the fix in more sane way

This commit is contained in:
Hadi Nategh 2017-06-14 14:52:31 +02:00
parent 04850b50ba
commit 1fc4f79850
2 changed files with 24 additions and 7 deletions

View File

@ -28,4 +28,28 @@ class Description extends Etemplate\Widget
* @var string|array * @var string|array
*/ */
protected $legacy_options = 'bold-italic,link,activate_links,label_for,link_target,link_popup_size,link_title'; 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 &lt;) 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);
}
}
}
} }

View File

@ -1936,13 +1936,6 @@ class calendar_uiforms extends calendar_ui
} }
$event = array_shift($events); $event = array_shift($events);
/* Encode html specialchars (eg. < to &lt;) 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 // convert event from servertime returned by calendar_ical to user-time
$this->bo->server2usertime($event); $this->bo->server2usertime($event);