Issue #2475001 by chris_hall_hu_cheng, jcnventura: Cache DateTime exception when Timezone not set

8.0.x
Alex Pott 2015-05-18 06:06:36 +01:00
parent 99aa2d6748
commit 8926759864
1 changed files with 2 additions and 2 deletions

View File

@ -222,8 +222,8 @@ class PageCache implements HttpKernelInterface {
}
// Use the actual timestamp from an Expires header, if available.
$date = $response->getExpires();
$expire = ($date > (new \DateTime())) ? $date->getTimestamp() : Cache::PERMANENT;
$date = $response->getExpires()->getTimestamp();
$expire = ($date > time()) ? $date : Cache::PERMANENT;
$tags = explode(' ', $response->headers->get('X-Drupal-Cache-Tags'));
$this->set($request, $response, $expire, $tags);