summaryrefslogtreecommitdiff
path: root/includes/form.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-09-05 13:05:31 +0000
committerDries Buytaert <dries@buytaert.net>2009-09-05 13:05:31 +0000
commit6586b7646585d34b878bda18155a37e5eec729cb (patch)
tree344c0b1fc90a22b8e896e40c27fa0edc421e93f5 /includes/form.inc
parent2f957104450835e8007a40af31d440f616517e7c (diff)
downloadbrdo-6586b7646585d34b878bda18155a37e5eec729cb.tar.gz
brdo-6586b7646585d34b878bda18155a37e5eec729cb.tar.bz2
- Patch by #1577 by chx, boombatower, Bèr Kessels, kkaefer: made SSL support a bit easier by providing two cookies and ... hook_goto_alter.
Diffstat (limited to 'includes/form.inc')
-rw-r--r--includes/form.inc8
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