Commit 0c5caac4 authored by Mingsong's avatar Mingsong Committed by Mingsong Hu

Issue #3065647 by Mingsong, danflanagan8, mandclu: Nested markup on titles...

Issue #3065647 by Mingsong, danflanagan8, mandclu: Nested markup on titles when "Use entity fields" unchecked
parent 3134192f
......@@ -24,7 +24,12 @@
// Event list tile html markup.
let eventListTitleEle = info.el.getElementsByClassName('fc-list-item-title');
if(eventListTitleEle.length > 0) {
eventListTitleEle[0].innerHTML = info.event.title;
if (info.event.url) {
eventListTitleEle[0].innerHTML = '<a href="' + info.event.url + '">' + info.event.title + '</a>';
}
else {
eventListTitleEle[0].innerHTML = info.event.title;
}
}
}
/**
......
......@@ -116,6 +116,12 @@ class FullcalendarViewPreprocess {
$entries = [];
if (!empty($start_field)) {
// Allowed tags for title markup.
$title_allowed_tags = Xss::getAdminTagList();
// Remove the 'a' tag from allowed list.
if (($tag_key = array_search('a', $title_allowed_tags)) !== false) {
unset($title_allowed_tags[$tag_key]);
}
// Timezone conversion service.
$timezone_service = \Drupal::service('fullcalendar_view.timezone_conversion_service');
// Save view results into entries array.
......@@ -171,7 +177,7 @@ class FullcalendarViewPreprocess {
if (!empty($start_dates) && is_array($start_dates)) {
foreach ($start_dates as $i => $start_date) {
$entry = [
'title' => Xss::filterAdmin($title),
'title' => Xss::filter($title, $title_allowed_tags),
'id' => $row->index . "-$i",
'eid' => $entity_id,
'url' => $link_url,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment