Skip to content

Commit 3f2166f

Browse files
committed
Fixes a "strftime() expects parameter 2 to be integer, string given" PHP Warning.
1 parent 3ec8b5d commit 3f2166f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/FontLib/BinaryStream.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,8 @@ public function readLongDateTime() {
275275
$this->readUInt32(); // ignored
276276
$date = $this->readUInt32() - 2082844800;
277277

278-
if ($date > PHP_INT_MAX) {
279-
$date = PHP_INT_MAX;
280-
} elseif ($date < PHP_INT_MIN) {
281-
$date = PHP_INT_MIN;
278+
if (is_string($date) || $date > PHP_INT_MAX || $date < PHP_INT_MIN) {
279+
$date = 0;
282280
}
283281

284282
return strftime("%Y-%m-%d %H:%M:%S", $date);

0 commit comments

Comments
 (0)