We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1e9e053 + e8a3335 commit f6d1257Copy full SHA for f6d1257
src/FontLib/BinaryStream.php
@@ -274,11 +274,12 @@ public function writeFixed($data) {
274
public function readLongDateTime() {
275
$this->readUInt32(); // ignored
276
$date = $this->readUInt32() - 2082844800;
277
+
278
+ # PHP_INT_MIN isn't defined in PHP < 7.0
279
+ $php_int_min = defined("PHP_INT_MIN") ? PHP_INT_MIN : ~PHP_INT_MAX;
280
- if ($date > PHP_INT_MAX) {
- $date = PHP_INT_MAX;
- } elseif ($date < PHP_INT_MIN) {
281
- $date = PHP_INT_MIN;
+ if (is_string($date) || $date > PHP_INT_MAX || $date < $php_int_min) {
282
+ $date = 0;
283
}
284
285
return strftime("%Y-%m-%d %H:%M:%S", $date);
0 commit comments