1
0
Fork 0

Optimize the regex detecting timestamps

Using a possessive quantifier avoids useless backtracking.
pull/4117/head
Christophe Coevoet 2015-06-07 10:38:27 +02:00
parent 9fb2d4f2d6
commit a014a2f803
1 changed files with 1 additions and 1 deletions

View File

@ -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'));