From ca6a7192470687a67e30f06726d64967ac9d3819 Mon Sep 17 00:00:00 2001 From: Wruczek Date: Wed, 12 Oct 2016 21:57:49 +0200 Subject: [PATCH] Small changes, fixed rare timezone issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed error: “date(): It is not safe to rely on the system's timezone settings…” --- .gitignore | 1 + api/status.php | 6 ++++-- bans.php | 2 +- config/config.template.php | 1 + viewer.php | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 42986f9..ef139ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ config/config.php prototypes/ +admin/ # PhpStorm .idea/ diff --git a/api/status.php b/api/status.php index 52328ca..c6c640d 100644 --- a/api/status.php +++ b/api/status.php @@ -6,6 +6,8 @@ set_error_handler("exception_error_handler", E_ALL); require_once __DIR__ . "/../include/tsutils.php"; require_once __DIR__ . "/../lib/phpfastcache/autoload.php"; +date_default_timezone_set($config["general"]["timezone"]); + use phpFastCache\Util; use phpFastCache\CacheManager; @@ -48,8 +50,8 @@ function scriptFail($error) { die(json_encode(array( "success" => false, "id" => "script_error", - "message" => "There has been an error while retrieving the server status" - ,"error" => $error + "message" => "There has been an error while retrieving the server status", + "error" => $error ))); } diff --git a/bans.php b/bans.php index 7e82199..7f62cde 100644 --- a/bans.php +++ b/bans.php @@ -55,7 +55,7 @@ if (is_null($banlist)) { diff --git a/config/config.template.php b/config/config.template.php index 8f86456..edd119c 100644 --- a/config/config.template.php +++ b/config/config.template.php @@ -16,6 +16,7 @@ $config["general"]["icon"] = "img/icon/icon-32.png"; $config["general"]["subtitle"] = " - Best TeamSpeak server!"; // Website subtitle $config["general"]["desc"] = "Polski serwer TeamSpeak! Zapraszamy :)"; // Website description - displayed in Google search engine $config["general"]["newsDir"] = "config/news"; // News folder (relative to project folder) +$config["general"]["timezone"] = "Europe/Warsaw"; // Your timezone - http://php.net/manual/en/timezones.php $config["general"]["enablehta"] = false; // Enable / Disable additional website features (recommended, but // you need to have up-to-date version of Apache and install mod_rewrite) diff --git a/viewer.php b/viewer.php index 7c9af7d..5d93dd7 100644 --- a/viewer.php +++ b/viewer.php @@ -42,7 +42,7 @@ function getViewer() {