security upadtes

This commit is contained in:
Bachir Soussi Chiadmi
2017-09-25 15:16:35 +02:00
parent 650c6448e4
commit 8d8a60b615
240 changed files with 3022 additions and 1300 deletions

View File

@@ -365,6 +365,19 @@ class views_plugin_display extends views_plugin {
return FALSE;
}
/**
* Should the enabled display more link being opened in an new window?
*
* @codingStandardsIgnoreStart
*/
function use_more_open_new_window() {
// @codingStandardsIgnoreEnd
if (!empty($this->definition['use more'])) {
return $this->get_option('open_new_window');
}
return FALSE;
}
/**
* Does the display have custom link text?
*/
@@ -414,9 +427,29 @@ class views_plugin_display extends views_plugin {
'hide_admin_links' => array('hide_admin_links'),
'group_by' => array('group_by'),
'query' => array('query'),
'use_more' => array('use_more', 'use_more_always', 'use_more_text'),
'use_more_always' => array('use_more', 'use_more_always', 'use_more_text'),
'use_more_text' => array('use_more', 'use_more_always', 'use_more_text'),
'use_more' => array('use_more',
'use_more_always',
'open_new_window',
'use_more_text',
),
'use_more_always' => array(
'use_more',
'use_more_always',
'open_new_window',
'use_more_text',
),
'use_more_text' => array(
'use_more',
'use_more_always',
'open_new_window',
'use_more_text',
),
'open_new_window' => array(
'use_more',
'use_more_always',
'open_new_window',
'use_more_text',
),
'link_display' => array('link_display', 'link_url'),
// Force these to cascade properly.
@@ -481,6 +514,7 @@ class views_plugin_display extends views_plugin {
'pager_options' => TRUE,
'use_more' => TRUE,
'use_more_always' => TRUE,
'open_new_window' => FALSE,
'use_more_text' => TRUE,
'exposed_form' => TRUE,
'exposed_form_options' => TRUE,
@@ -1061,6 +1095,11 @@ class views_plugin_display extends views_plugin {
$title = $text;
}
// Truncate the path as it is displayed as a link.
if ($section == 'path') {
$text = views_ui_truncate($text, 24);
}
return l($text, 'admin/structure/views/nojs/display/' . $this->view->name . '/' . $this->display->id . '/' . $section, array('attributes' => array('class' => 'views-ajax-link ' . $class, 'title' => $title, 'id' => drupal_html_id('views-' . $this->display->id . '-' . $section)), 'html' => TRUE));
}
@@ -1468,7 +1507,7 @@ class views_plugin_display extends views_plugin {
$form['#title'] .= t('The title of this view');
$form['title'] = array(
'#type' => 'textfield',
'#description' => t('This title will be displayed with the view, wherever titles are normally displayed; i.e, as the page title, block title, etc.'),
'#description' => t('This title will be displayed with the view, wherever titles are normally displayed; i.e, as the page title, block title, etc. Use <none> to not assign a title; this can allow other modules to control the page title.'),
'#default_value' => $this->get_option('title'),
);
break;
@@ -1524,6 +1563,17 @@ class views_plugin_display extends views_plugin {
'edit-use-more' => array(TRUE),
),
);
$form['open_new_window'] = array(
'#type' => 'checkbox',
'#title' => t("Open 'more' link in new window (target='blank')"),
'#description' => t("Leave this unchecked to open the more link in the same window."),
'#default_value' => $this->get_option('open_new_window'),
'#dependency' => array(
'edit-use-more' => array(TRUE),
),
);
$form['use_more_text'] = array(
'#type' => 'textfield',
'#title' => t('More link text'),
@@ -2381,6 +2431,7 @@ class views_plugin_display extends views_plugin {
case 'use_more':
$this->set_option($section, intval($form_state['values'][$section]));
$this->set_option('use_more_always', !intval($form_state['values']['use_more_always']));
$this->set_option('open_new_window', $form_state['values']['open_new_window']) == '1';
$this->set_option('use_more_text', $form_state['values']['use_more_text']);
case 'distinct':
$this->set_option($section, $form_state['values'][$section]);
@@ -2594,7 +2645,7 @@ class views_plugin_display extends views_plugin {
$path = check_url(url($path, $url_options));
return theme($theme, array('more_url' => $path, 'link_text' => check_plain($this->use_more_text()), 'view' => $this->view));
return theme($theme, array('more_url' => $path, 'new_window' => $this->use_more_open_new_window(), 'link_text' => check_plain($this->use_more_text()), 'view' => $this->view));
}
}
}
@@ -2798,7 +2849,7 @@ class views_plugin_display extends views_plugin {
}
}
else {
if ($id != $key && $identifier == $handler->options['expose']['identifier']) {
if ($id != $key && isset($handler->options['expose']['identifier']) && $identifier == $handler->options['expose']['identifier']) {
return FALSE;
}
}