security update for context link entity_reference

This commit is contained in:
2019-04-23 15:57:22 +02:00
parent 16996e1775
commit 835220fa8b
41 changed files with 1829 additions and 657 deletions
@@ -243,6 +243,11 @@ function context_preprocess_menu_link(&$variables) {
// css class to the link of this menu.
// - Do not add class twice on current page.
if (in_array($variables['element']['#href'], $reaction_menu_paths) && $variables['element']['#href'] != $_GET['q']) {
// Initialize classes array if not set.
if (!isset($variables['element']['#localized_options']['attributes']['class'])) {
$variables['element']['#localized_options']['attributes']['class'] = array();
}
// Do not add the 'active' class twice in views tabs.
if (!in_array('active', $variables['element']['#localized_options']['attributes']['class'])) {
$variables['element']['#localized_options']['attributes']['class'][] = 'active';