aboutsummaryrefslogtreecommitdiff
path: root/pmwiki.php
diff options
context:
space:
mode:
authorpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2023-10-23 10:06:30 +0000
committerpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2023-10-23 10:06:30 +0000
commit5f110f24e2e7bededb72e5feda041830beb5b199 (patch)
treeee7a29c2626aa4f5661045267fe5f45168f147bd /pmwiki.php
parentf216398849e05f7bbd3f3ea1c0f7b748d1e5c9c7 (diff)
downloadpmwiki.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.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/pmwiki.php b/pmwiki.php
index 4e75fc2a..88da34c7 100644
--- a/pmwiki.php
+++ b/pmwiki.php
@@ -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'];