contrib modules security updates

This commit is contained in:
Bachir Soussi Chiadmi
2016-10-13 12:10:40 +02:00
parent ffd758abc9
commit 747127f643
732 changed files with 67976 additions and 23207 deletions

View File

@@ -286,7 +286,8 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR
$display->context = $contexts;
$display->args = $args;
$display->css_id = $handler->conf['css_id'];
$page_css_id = ctools_context_keyword_substitute($handler->conf['css_id'], array(), $contexts);
$display->css_id = check_plain($page_css_id);
$task_name = page_manager_make_task_name($handler->task, $handler->subtask);
$display->cache_key = panels_panel_context_cache_key($task_name, $handler->name, $args);
@@ -297,7 +298,9 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR
$css_id = 'panel_context:' . $handler->name;
$filename = ctools_css_retrieve($css_id);
if (!$filename) {
$filename = ctools_css_store($css_id, $handler->conf['css']);
// Add keywords from context
$css = ctools_context_keyword_substitute($handler->conf['css'], array(), $contexts, array('css safe' => TRUE));
$filename = ctools_css_store($css_id, $css);
}
drupal_add_css($filename);
}
@@ -317,11 +320,23 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR
// Remove and add body element classes
$panel_body_css = &drupal_static('panel_body_css');
if (isset($handler->conf['body_classes_to_remove']) && !isset($panel_body_css['body_classes_to_remove'])) {
$panel_body_css['body_classes_to_remove'] = $handler->conf['body_classes_to_remove'];
if (isset($handler->conf['body_classes_to_remove'])) {
$classes = ctools_context_keyword_substitute($handler->conf['body_classes_to_remove'], array(), $contexts, array('css safe' => TRUE));
if (!isset($panel_body_css['body_classes_to_remove'])) {
$panel_body_css['body_classes_to_remove'] = check_plain($classes);
}
else{
$panel_body_css['body_classes_to_remove'] .= ' ' . check_plain($classes);
}
}
if (isset($handler->conf['body_classes_to_add']) && !isset($panel_body_css['body_classes_to_add'])) {
$panel_body_css['body_classes_to_add'] = $handler->conf['body_classes_to_add'];
if (isset($handler->conf['body_classes_to_add'])) {
$classes = ctools_context_keyword_substitute($handler->conf['body_classes_to_add'], array(), $contexts, array('css safe' => TRUE));
if (!isset($panel_body_css['body_classes_to_add'])) {
$panel_body_css['body_classes_to_add'] = check_plain($classes);
}
else {
$panel_body_css['body_classes_to_add'] .= ' '. check_plain($classes);
}
}
$info = array(
@@ -393,7 +408,10 @@ function panels_panel_context_export(&$handler, $indent) {
unset($handler->conf[$item]);
}
}
$display->did = 'new';
$display = (object) array(
'did' => 'new',
'uuid' => ctools_uuid_generate(),
);
$handler->conf['display'] = $display;
}
@@ -568,6 +586,19 @@ function panels_panel_context_edit_choose($form, &$form_state) {
$form_state['display'] = &panels_panel_context_get_display($form_state['handler']);
// Grab the storage_type and storage_id and inject it into the display.
if (empty($form_state['display']->storage_type)) {
if (!isset($form_state[$form_state['task_id']]->storage_type)) {
watchdog('panels', "Unable to find the storage type for specified storage. Read 'Upgrading task handlers' in CHANGELOG.txt", array(), WATCHDOG_ERROR);
$form_state['display']->storage_type = 'unknown';
}
else {
$form_state['display']->storage_type = $form_state[$form_state['task_id']]->storage_type;
}
// When adding variants, we don't know the handler id yet. In that case,
// Mark it as new. We'll assign it later.
$form_state['display']->storage_id = !empty($form_state['handler_id']) ? $form_state['handler_id'] : 'new';
}
// Tell the Panels form not to display buttons.
$form_state['no buttons'] = TRUE;
@@ -725,6 +756,10 @@ function panels_panel_context_edit_content_validate(&$form, &$form_state) {
}
function panels_panel_context_edit_content_submit(&$form, &$form_state) {
// Update the storage_id if this is a new variant before saving.
if ($form_state['display']->storage_id == 'new') {
$form_state['display']->storage_id = $form_state['handler_id'];
}
panels_edit_display_form_submit($form, $form_state);
$handler = &$form_state['handler'];
@@ -760,17 +795,17 @@ function panels_panel_context_edit_settings($form, &$form_state) {
$form['conf']['body_classes_to_remove'] = array(
'#type' => 'textfield',
'#size' => 128,
'#default_value' => $conf['body_classes_to_remove'],
'#default_value' => empty($conf['body_classes_to_remove']) ? '' : $conf['body_classes_to_remove'],
'#title' => t('Remove body CSS classes'),
'#description' => t('The CSS classes to remove from the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars.'),
'#description' => t('The CSS classes to remove from the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars. Keywords from context are allowed.'),
);
$form['conf']['body_classes_to_add'] = array(
'#type' => 'textfield',
'#size' => 128,
'#default_value' => $conf['body_classes_to_add'],
'#default_value' => empty($conf['body_classes_to_add']) ? '' : $conf['body_classes_to_add'],
'#title' => t('Add body CSS classes'),
'#description' => t('The CSS classes to add to the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars.'),
'#description' => t('The CSS classes to add to the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars. Keywords from context are allowed.'),
);
ctools_include('plugins', 'panels');
@@ -810,13 +845,13 @@ function panels_panel_context_edit_settings($form, &$form_state) {
'#size' => 35,
'#default_value' => $conf['css_id'],
'#title' => t('CSS ID'),
'#description' => t('The CSS ID to apply to this page'),
'#description' => t('The CSS ID to apply to this page. Keywords from context are allowed.'),
);
$form['conf']['css'] = array(
'#type' => 'textarea',
'#title' => t('CSS code'),
'#description' => t('Enter well-formed CSS code here; this code will be embedded into the page, and should only be used for minor adjustments; it is usually better to try to put CSS for the page into the theme if possible. This CSS will be filtered for safety so some CSS may not work.'),
'#description' => t('Enter well-formed CSS code here; this code will be embedded into the page, and should only be used for minor adjustments; it is usually better to try to put CSS for the page into the theme if possible. This CSS will be filtered for safety so some CSS may not work. Keywords from context are allowed.'),
'#default_value' => $conf['css'],
);
@@ -900,12 +935,25 @@ function panels_panel_context_get_addressable($task, $subtask_name, $handler, $a
$display->cache_key = panels_panel_context_cache_key($task->name, $handler->name, $arguments);
$renderer = panels_get_renderer($handler->conf['pipeline'], $display);
if ($type == 'content') {
$renderer->prepare();
$renderer->prepare();
if ($address) {
$pid = array_shift($address);
if (!empty($renderer->prepared['panes'][$pid])) {
return $renderer->render_pane($renderer->prepared['panes'][$pid]);
if ($type == 'content') {
return $renderer->render_pane($renderer->prepared['panes'][$pid]);
}
elseif ($type == 'pane') {
return $renderer->prepared['panes'][$pid];
}
}
}
else {
if ($type == 'content') {
return $renderer->render();
}
elseif ($type == 'renderer') {
return $renderer;
}
}
}