assume local timezone for local hostnames

This commit is contained in:
Robin Appelman 2018-08-24 15:12:43 +02:00
commit c7f89d014c

View file

@ -28,7 +28,8 @@ class TimeZoneProvider implements ITimeZoneProvider {
public function get($host) { public function get($host) {
if (!isset($this->timeZones[$host])) { if (!isset($this->timeZones[$host])) {
$net = $this->system->getNetPath(); $net = $this->system->getNetPath();
if ($net && $host) { // for local domain names we can assume same timezone
if ($net && $host && strpos($host, '.') !== false) {
$command = sprintf('%s time zone -S %s', $command = sprintf('%s time zone -S %s',
$net, $net,
escapeshellarg($host) escapeshellarg($host)