X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=index.php;h=7f2afffb5a01b0cac1a36953f450152150ab20ea;hb=4883069177fbdd4c430661fc47c4669d0b1ff230;hp=ea5c802779eb9aaf4cb623fcc95ef989f578a63b;hpb=4168b9cec1f7b2e6421c018e56e3b9a13c14d581;p=quix0rs-gnu-social.git diff --git a/index.php b/index.php index ea5c802779..7f2afffb5a 100644 --- a/index.php +++ b/index.php @@ -19,26 +19,35 @@ * @category StatusNet * @package StatusNet * @author Brenda Wallace + * @author Brion Vibber * @author Christopher Vollick * @author CiaranG * @author Craig Andrews * @author Evan Prodromou * @author Gina Haeussge + * @author James Walker * @author Jeffery To * @author Mike Cochrane * @author Robin Millette * @author Sarven Capadisli * @author Tom Adams + * @author Zach Copley + * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * * @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; @@ -185,7 +194,7 @@ function checkMirror($action_obj, $args) function isLoginAction($action) { - static $loginActions = array('login', 'recoverpassword', 'api', 'doc', 'register', 'publicxrds', 'otp'); + static $loginActions = array('login', 'recoverpassword', 'api', 'doc', 'register', 'publicxrds', 'otp', 'opensearch', 'rsd', 'hostmeta'); $login = null; @@ -200,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; }