]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - index.php
Merge branch '1.0.x' into schema-x
[quix0rs-gnu-social.git] / index.php
index 3efe5c8e494a6f5c5bf04e1c4eb5e70b0251542a..5a08aa07825c4d11b87a2e726c81c1db5be8b4ee 100644 (file)
--- a/index.php
+++ b/index.php
@@ -204,7 +204,7 @@ function checkMirror($action_obj, $args)
 
 function isLoginAction($action)
 {
-    static $loginActions =  array('login', 'recoverpassword', 'api', 'doc', 'register', 'publicxrds', 'otp', 'opensearch', 'rsd');
+    static $loginActions =  array('login', 'recoverpassword', 'api', 'doc', 'register', 'publicxrds', 'otp', 'opensearch', 'rsd', 'hostmeta');
 
     $login = null;
 
@@ -283,6 +283,14 @@ function main()
         return;
     }
 
+    $site_ssl = common_config('site', 'ssl');
+
+    // If the request is HTTP and it should be HTTPS...
+    if ($site_ssl != 'never' && !StatusNet::isHTTPS() && common_is_sensitive($args['action'])) {
+        common_redirect(common_local_url($args['action'], $args));
+        return;
+    }
+
     $args = array_merge($args, $_REQUEST);
 
     Event::handle('ArgsInitialize', array(&$args));