commit 80ce9c75b72cedd77884ed91b41f38b2301244ac
parent 5bc785fac396ca2a49daa0721cc7009b9009a3d3
Author: markseu <mark2011@mayberg.se>
Date: Mon, 16 May 2022 17:25:46 +0200
Updated core extension, timezone
Diffstat:
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/system/extensions/core.php b/system/extensions/core.php
@@ -2,7 +2,7 @@
// Core extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/core
class YellowCore {
- const VERSION = "0.8.81";
+ const VERSION = "0.8.82";
const RELEASE = "0.8.20";
public $page; // current page
public $content; // content files
@@ -3249,10 +3249,15 @@ class YellowToolbox {
// Detect server timezone
public function detectServerTimezone() {
- $timezone = @date_default_timezone_get();
- if (PHP_OS=="Darwin" && $timezone=="UTC") {
- if (preg_match("#zoneinfo/(.*)#", @readlink("/etc/localtime"), $matches)) $timezone = $matches[1];
+ $timezone = ini_get("date.timezone");
+ if (empty($timezone)) {
+ if (PHP_OS=="Darwin") {
+ if (preg_match("#zoneinfo/(.*)#", @readlink("/etc/localtime"), $matches)) $timezone = $matches[1];
+ } else {
+ if (preg_match("/^(\S+)\/(\S+)/", $this->readFile("/etc/timezone"), $matches)) $timezone = $matches[1];
+ }
}
+ if (empty($timezone)) $timezone = "UTC";
return $timezone;
}
@@ -3264,7 +3269,7 @@ class YellowToolbox {
if (preg_match("/^(\S+)\/(\S+)/", $this->getServer("SERVER_SOFTWARE"), $matches)) {
$name = $matches[1];
$version = $matches[2];
- } elseif (preg_match("/^(\S+)/u", $this->getServer("SERVER_SOFTWARE"), $matches)) {
+ } elseif (preg_match("/^(\S+)/", $this->getServer("SERVER_SOFTWARE"), $matches)) {
$name = $matches[1];
}
if (PHP_SAPI=="cli" || PHP_SAPI=="cli-server") {
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -21,11 +21,11 @@ Tag: feature
system/extensions/command.php: command.php, create, update
Extension: Core
-Version: 0.8.81
+Version: 0.8.82
Description: Core functionality of the website.
DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/core
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/core.zip
-Published: 2022-05-14 12:50:14
+Published: 2022-05-16 17:15:20
Developer: Datenstrom
Tag: feature
system/extensions/core.php: core.php, create, update