X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=index.php;h=7f2afffb5a01b0cac1a36953f450152150ab20ea;hb=be682a3f8c802fb0f61b38f4689decb10eed1715;hp=bf6cf7c00ca7eee261323185e61d41ad0c353f89;hpb=7f3b3620af2af88ced37da1d9f8913cfd1a31b90;p=quix0rs-gnu-social.git diff --git a/index.php b/index.php index bf6cf7c00c..7f2afffb5a 100644 --- a/index.php +++ b/index.php @@ -37,12 +37,17 @@ * @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 require_once INSTALLDIR . '/lib/common.php'; +register_shutdown_function('common_log_perf_counters'); + $user = null; $action = null; @@ -189,7 +194,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; @@ -204,18 +209,18 @@ 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'] != '/') { $_lighty_path = preg_replace('/^'.preg_quote(common_config('site', 'path')).'\//', '', substr($_lighty_url['path'], 1)); $_SERVER['QUERY_STRING'] = 'p='.$_lighty_path; - if ($_lighty_url['query']) { + if (isset($_lighty_url['query']) && $_lighty_url['query'] != '') { $_SERVER['QUERY_STRING'] .= '&'.$_lighty_url['query']; - } - parse_str($_lighty_url['query'], $_lighty_query); - foreach ($_lighty_query as $key => $val) { - $_GET[$key] = $_REQUEST[$key] = $val; + parse_str($_lighty_url['query'], $_lighty_query); + foreach ($_lighty_query as $key => $val) { + $_GET[$key] = $_REQUEST[$key] = $val; + } } $_GET['p'] = $_REQUEST['p'] = $_lighty_path; }