]> git.mxchange.org Git - friendica.git/commitdiff
Reload a non-ssl-request to a ssl-request. (only when SSL_POLICY_FULL is enabled)
authorMichael Vogel <icarus@dabo.de>
Thu, 23 Oct 2014 22:52:29 +0000 (00:52 +0200)
committerMichael Vogel <icarus@dabo.de>
Thu, 23 Oct 2014 22:52:29 +0000 (00:52 +0200)
boot.php
index.php

index 0d7c6e878fafa402d743c5bce0d04f0a8eeb5059..05be15b7d79942c85937d974a7c4c265c9d11e61 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -609,6 +609,10 @@ if(! class_exists('App')) {
                        return($basepath);
                }
 
+               function get_scheme() {
+                       return($this->scheme);
+               }
+
                function get_baseurl($ssl = false) {
 
                        $scheme = $this->scheme;
index d628f9ad214397acfad50f7685fb3c23d9cb202a..45d1599692246715208fc0f886ba7889be0a998a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -53,6 +53,13 @@ if(!$install) {
        load_config('config');
        load_config('system');
 
+       if ((intval(get_config('system','ssl_policy')) == SSL_POLICY_FULL) AND
+               ($a->get_scheme() == "http") AND
+               (substr($a->get_baseurl(), 0, 8) == "https://")) {
+               header("HTTP/1.1 302 Moved Temporarily");
+               header("location: ".$a->get_baseurl()."/".$a->query_string);
+       }
+
        require_once("include/session.php");
        load_hooks();
        call_hooks('init_1');