Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
U
uw_security
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
WCMS
uw_security
Commits
a1d7d160
Commit
a1d7d160
authored
Dec 15, 2016
by
Liam Morland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RT#567327: Remove uw_security_form_alter()
This effectively reverts
80dc909c
.
parent
2192be78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
19 deletions
+0
-19
uw_security.module
uw_security.module
+0
-19
No files found.
uw_security.module
View file @
a1d7d160
...
...
@@ -4,25 +4,6 @@
* @file
*/
/**
* Implements hook_form_alter().
*
* Redirect all pages containing a form to HTTPS.
* Code based on securelogin module.
*/
function
uw_security_form_alter
(
&
$form
,
&
$form_state
,
$form_id
)
{
global
$is_https
;
// Flag form as secure for theming purposes.
$form
[
'#https'
]
=
TRUE
;
// POST requests are not redirected, to prevent unintentional redirects which result in lost POST data.
if
(
!
$is_https
&&
$_SERVER
[
'REQUEST_METHOD'
]
!==
'POST'
&&
!
drupal_is_cli
())
{
// Ignore the destination for this redirect (it was preserved in the query).
unset
(
$_GET
[
'destination'
]);
// Can't use https option to url() because we are not setting the https global variable (which is bad for security).
drupal_goto
(
preg_replace
(
'/^http:/'
,
'https:'
,
url
(
$_GET
[
'q'
],
array
(
'query'
=>
drupal_get_query_parameters
(),
'absolute'
=>
TRUE
))),
array
(),
301
);
}
}
/**
* Implements hook_user_logout().
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment