Optimize the regex detecting timestamps
Using a possessive quantifier avoids useless backtracking.pull/4117/head
parent
9fb2d4f2d6
commit
a014a2f803
|
@ -147,7 +147,7 @@ class ArrayLoader implements LoaderInterface
|
|||
}
|
||||
|
||||
if (!empty($config['time'])) {
|
||||
$time = preg_match('/^\d+$/D', $config['time']) ? '@'.$config['time'] : $config['time'];
|
||||
$time = preg_match('/^\d++$/D', $config['time']) ? '@'.$config['time'] : $config['time'];
|
||||
|
||||
try {
|
||||
$date = new \DateTime($time, new \DateTimeZone('UTC'));
|
||||
|
|
Loading…
Reference in New Issue