Commit 89267598 authored by alexpott's avatar alexpott

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

parent 99aa2d67
......@@ -222,8 +222,8 @@ protected function fetch(Request $request, $type = self::MASTER_REQUEST, $catch
}
// 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment