Skip to content

Commit

Permalink
Fix #2221 parse with no separators
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Oct 12, 2020
1 parent 35959c9 commit e148788
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Carbon/Traits/Creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct($time = null, $tz = null)
$time = $this->constructTimezoneFromDateTime($time, $tz)->format('Y-m-d H:i:s.u');
}

if (is_numeric($time) && (!is_string($time) || $time < 0 || $time > 99991231)) {
if (is_numeric($time) && (!is_string($time) || !preg_match('/^\d{1,14}$/', $time))) {
$time = static::createFromTimestampUTC($time)->format('Y-m-d\TH:i:s.uP');
}

Expand Down

0 comments on commit e148788

Please sign in to comment.