X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=index.php;h=c8d4fbee9b0f30a6e44325b2a6508cef02a377f8;hb=8cde66a8ed49c2409714ae6f3abb11579acbb680;hp=21e222e3b803c2d45e7dae07511b84eed66a0bf6;hpb=5c4723919fa757b3e14a59350415cfe53e0900d1;p=quix0rs-gnu-social.git diff --git a/index.php b/index.php index 21e222e3b8..c8d4fbee9b 100644 --- a/index.php +++ b/index.php @@ -37,6 +37,9 @@ * @license GNU Affero General Public License http://www.gnu.org/licenses/ */ +$_startTime = microtime(true); +$_perfCounters = array(); + define('INSTALLDIR', dirname(__FILE__)); define('STATUSNET', true); define('LACONICA', true); // compatibility @@ -219,7 +222,7 @@ function main() { // fake HTTP redirects using lighttpd's 404 redirects if (strpos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false) { - $_lighty_url = $base_url.$_SERVER['REQUEST_URI']; + $_lighty_url = $_SERVER['REQUEST_URI']; $_lighty_url = @parse_url($_lighty_url); if ($_lighty_url['path'] != '/index.php' && $_lighty_url['path'] != '/') { @@ -283,6 +286,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));