diff --git a/core/install.php b/core/install.php index 269f222d..898bda37 100644 --- a/core/install.php +++ b/core/install.php @@ -15,7 +15,8 @@ * and other such things that aren't ready yet */ -function install() { +function install() +{ date_default_timezone_set('UTC'); define("DATABASE_TIMEOUT", 10000); @@ -49,15 +50,15 @@ function install() { require_once "core/util.php"; $dsn = get_dsn(); - if($dsn) { + if ($dsn) { do_install($dsn); } else { ask_questions(); } - } -function get_dsn() { +function get_dsn() +{ if (file_exists("data/config/auto_install.conf.php")) { $dsn = null; require_once "data/config/auto_install.conf.php"; @@ -72,7 +73,8 @@ function get_dsn() { return $dsn; } -function do_install($dsn) { +function do_install($dsn) +{ try { create_dirs(); create_tables(new Database($dsn)); @@ -80,7 +82,6 @@ function do_install($dsn) { } catch (InstallerException $e) { exit_with_page($e->title, $e->body, $e->code); } - } function ask_questions() @@ -129,7 +130,7 @@ function ask_questions() exit_with_page( "Install Options", -<< -EOD); +EOD + ); } @@ -337,7 +339,8 @@ function write_config($dsn) } } -function exit_with_page($title, $body, $code=0) { +function exit_with_page($title, $body, $code=0) +{ print(" diff --git a/core/util.php b/core/util.php index 17b6b3e2..bca79a92 100644 --- a/core/util.php +++ b/core/util.php @@ -471,7 +471,7 @@ function get_debug_info(): string function require_all(array $files): void { foreach ($files as $filename) { - require_once $filename; + require_once $filename; } } diff --git a/ext/index/main.php b/ext/index/main.php index b1931da3..04253c08 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -45,10 +45,12 @@ class Index extends Extension try { $fast_page_limit = 500; - if( - SPEED_HAX - && strstr($_SERVER["HTTP_USER_AGENT"], "Googlebot") !== false - && count($search_terms) > 1 + if ( + SPEED_HAX && strstr($_SERVER["HTTP_USER_AGENT"], "Googlebot") !== false + && ( + $count_search_terms > 1 + || ($count_search_terms == 1 && $search_terms[0][0] == "-") + ) ) { // googlebot loves searching for weird combinations of tags... $fast_page_limit = 50; diff --git a/index.php b/index.php index 0457c9f4..3098c83a 100644 --- a/index.php +++ b/index.php @@ -139,12 +139,12 @@ $_tracer->end(); //$_tracer->mark(@$_SERVER["REQUEST_URI"]); $_tracer->begin( - $_SERVER["REQUEST_URI"] ?? "No Request", - [ - "user"=>$_COOKIE["shm_user"] ?? "No User", - "ip"=>$_SERVER['REMOTE_ADDR'] ?? "No IP", - "user_agent"=>$_SERVER['HTTP_USER_AGENT'] ?? "No UA", - ] + $_SERVER["REQUEST_URI"] ?? "No Request", + [ + "user"=>$_COOKIE["shm_user"] ?? "No User", + "ip"=>$_SERVER['REMOTE_ADDR'] ?? "No IP", + "user_agent"=>$_SERVER['HTTP_USER_AGENT'] ?? "No UA", + ] ); if (!SPEED_HAX) {