diff options
Diffstat (limited to 'includes/form.inc')
-rw-r--r-- | includes/form.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/form.inc b/includes/form.inc index 6bde787aa..55eb5e5fe 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -979,6 +979,14 @@ function form_builder($form_id, $element, &$form_state) { // Special handling if we're on the top level form element. if (isset($element['#type']) && $element['#type'] == 'form') { + if (!empty($element['#https']) && variable_get('https', FALSE) && + !menu_path_is_external($element['#action'])) { + global $base_root; + + // Not an external URL so ensure that it is secure. + $element['#action'] = str_replace('http://', 'https://', $base_root) . $element['#action']; + } + // Store a complete copy of the form in form_state prior to building the form. $form_state['complete form'] = $element; // Set a flag if we have a correct form submission. This is always TRUE for |