Skip to content

Commit 3ec8b5d

Browse files
committed
Merge pull request #43 from BrunoDeBarros/patch-2
Fixes "strftime() expects parameter 2 to be integer, float given" PHP Warning.
2 parents 4fec908 + b441fea commit 3ec8b5d

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
@@ -275,6 +275,12 @@ 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;
282+
}
283+
278284
return strftime("%Y-%m-%d %H:%M:%S", $date);
279285
}
280286

0 commit comments

Comments
 (0)