Skip to content

Commit 08f6a0e

Browse files
committed
Fix fatal error when stftime format was null
Before the polyfill, this would only have returned false. So this is a bc fix.
1 parent 7324c9d commit 08f6a0e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/functions.inc.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ function serendipity_strftime($format, $timestamp = null, $useOffset = true, $us
140140
} elseif ($useOffset) {
141141
$timestamp = serendipity_serverOffsetHour($timestamp);
142142
}
143-
$out = PHP81_BC\strftime($format, (int)$timestamp);
143+
if ($format == null) {
144+
$out = false;
145+
} else {
146+
$out = PHP81_BC\strftime($format, (int)$timestamp);
147+
}
144148
break;
145149

146150
case 'persian-utf8':

0 commit comments

Comments
 (0)