mirror of
https://github.com/Cacti/cacti.git
synced 2026-12-02 13:18:12 +09:00
Fixing #5648 - Time Zone issues with GMT/Etc+Fraction
Fractional time offsets can cause huge webserver error-logs
This commit is contained in:
1 parent
8fd86aa524
commit
866ae4e827
2 files changed
+5
-2
No files matched your search
@@ -102,6 +102,7 @@ Cacti CHANGELOG
|
||||
1.2.27
|
||||
-issue#5622: Errors and deprecation warnings with PHP 8.3.0
|
||||
-issue#5638: Add tooltip info about IPv6 address
|
||||
-issue#5648: Fractional time offsets can cause huge webserver error-logs
|
||||
-issue#5649: Inapprorpiate use of PHP_OS in lib/ping.php on Windows Platform
|
||||
|
||||
1.2.26
|
||||
|
||||
+4
-2
@@ -8415,8 +8415,10 @@ function cacti_time_zone_set($gmt_offset) {
|
||||
$php_offset = $zone;
|
||||
ini_set('date.timezone', $zone);
|
||||
} else {
|
||||
$php_offset = 'Etc/GMT' . ($hours > 0 ? '-':'+') . abs($hours);
|
||||
ini_set('date.timezone', 'Etc/GMT' . ($hours > 0 ? '-':'+') . abs($hours));
|
||||
// Adding the rounding function as some timezones are Etc/GMT+5.5 which is
|
||||
// not supported in PHP yet.
|
||||
$php_offset = 'Etc/GMT' . ($hours > 0 ? '-':'+') . abs(round($hours));
|
||||
ini_set('date.timezone', 'Etc/GMT' . ($hours > 0 ? '-':'+') . abs(round($hours)));
|
||||
}
|
||||
|
||||
$_SESSION[SESS_BROWSER_SYSTEM_TZ] = $sys_offset;
|
||||
|
||||
Reference in new issue
Block a user