diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2023-10-23 10:06:30 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2023-10-23 10:06:30 +0000 |
commit | 5f110f24e2e7bededb72e5feda041830beb5b199 (patch) | |
tree | ee7a29c2626aa4f5661045267fe5f45168f147bd /pmwiki.php | |
parent | f216398849e05f7bbd3f3ea1c0f7b748d1e5c9c7 (diff) | |
download | pmwiki.svn-5f110f24e2e7bededb72e5feda041830beb5b199.tar.bz2 |
Restore default timezone if the provided one is invalid.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4513 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'pmwiki.php')
-rw-r--r-- | pmwiki.php | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -704,6 +704,10 @@ function PSFT($fmt, $stamp=null, $locale=null, $tz=null) { # strftime() replacem $fmt = preg_replace('/(?<!%)(%L)/', $gmt, $fmt); } + if ($tz) { + $tzo = @timezone_open($tz); + if (!@$tzo) unset($tz); + } if (! $cached['new']) { if (@$locale) setlocale(LC_TIME, preg_split('/[, ]+/', $locale, -1, PREG_SPLIT_NO_EMPTY)); @@ -718,10 +722,6 @@ function PSFT($fmt, $stamp=null, $locale=null, $tz=null) { # strftime() replacem } $timestamp = date_create("@$stamp"); - if ($tz) { - $tzo = @timezone_open($tz); - if (!@$tzo) unset($tz); - } if (!@$tz) { # need to set it otherwise resets to GMT $tz = $cached['dtz']; $tzo = $cached['dtzo']; |