Skip to content

Commit b441fea

Browse files
committed
Fixes "strftime() expects parameter 2 to be integer, float given" PHP Warning.
1 parent f4e096e commit b441fea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/FontLib/BinaryStream.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ public function readLongDateTime() {
274274
$this->readUInt32(); // ignored
275275
$date = $this->readUInt32() - 2082844800;
276276

277+
if ($date > PHP_INT_MAX) {
278+
$date = PHP_INT_MAX;
279+
} elseif ($date < PHP_INT_MIN) {
280+
$date = PHP_INT_MIN;
281+
}
282+
277283
return strftime("%Y-%m-%d %H:%M:%S", $date);
278284
}
279285

0 commit comments

Comments
 (0)