* @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
{
// 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'] != '/') {
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));