updated core to 7.73
This commit is contained in:
@@ -78,6 +78,20 @@ function overlay_theme() {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_form_alter().
|
||||
*/
|
||||
function overlay_form_alter(&$form, &$form_state) {
|
||||
// Add a hidden element to prevent dropping out of the overlay when a form is
|
||||
// submitted inside the overlay using a GET method.
|
||||
if (isset($form['#method']) && $form['#method'] == 'get' && isset($_REQUEST['render']) && $_REQUEST['render'] == 'overlay' && !isset($form['render'])) {
|
||||
$form['render'] = array(
|
||||
'#type' => 'hidden',
|
||||
'#value' => 'overlay',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_form_FORM_ID_alter().
|
||||
*/
|
||||
@@ -146,6 +160,10 @@ function overlay_init() {
|
||||
// If this page shouldn't be rendered inside the overlay, redirect to the
|
||||
// parent.
|
||||
elseif (!path_is_admin($current_path)) {
|
||||
// Prevent open redirects by ensuring the current path is not an absolute URL.
|
||||
if (url_is_external($current_path)) {
|
||||
$current_path = '<front>';
|
||||
}
|
||||
overlay_close_dialog($current_path, array('query' => drupal_get_query_parameters(NULL, array('q', 'render'))));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user