Skip to content

Commit

Permalink
#446 implement force https redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
ximex committed Nov 14, 2016
1 parent 1e09dce commit 1ef21c9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions adm_program/system/common.php
Expand Up @@ -46,6 +46,17 @@
// LOGGING
require_once(ADMIDIO_PATH . '/adm_program/system/logging.php');

// Force permanent HTTPS redirect
if (isset($gForceHTTPS) && $gForceHTTPS && !HTTPS)
{
$url = str_replace('http://', 'https://', CURRENT_URL);

$gLogger->notice('REDIRECT: Redirecting permanent to HTTPS!', array('url' => $url, 'statusCode' => 301));

header('Location: ' . $url, true, 301);
exit();
}

// remove HTML & PHP-Code from all parameters
$_GET = admStrStripTagsSpecial($_GET);
$_POST = admStrStripTagsSpecial($_POST);
Expand Down

0 comments on commit 1ef21c9

Please sign in to comment.