[HttpKernel] fixed an error message
This commit is contained in:
parent
8aa322ca72
commit
f4adfc4d79
@ -298,10 +298,11 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
||||
} elseif ($expires instanceof \DateTime) {
|
||||
$expires = $expires->getTimestamp();
|
||||
} else {
|
||||
$expires = strtotime($expires);
|
||||
if (false === $expires || -1 == $expires) {
|
||||
throw new \InvalidArgumentException(sprintf('The "expires" cookie parameter is not valid.', $expires));
|
||||
$tmp = strtotime($expires);
|
||||
if (false === $tmp || -1 == $tmp) {
|
||||
throw new \InvalidArgumentException(sprintf('The "expires" cookie parameter is not valid (%s).', $expires));
|
||||
}
|
||||
$expires = $tmp;
|
||||
}
|
||||
|
||||
$cookie .= '; expires='.str_replace('+0000', '', \DateTime::createFromFormat('U', $expires, new \DateTimeZone('GMT'))->format('D, d-M-Y H:i:s T'));
|
||||
|
Reference in New Issue
Block a user