From 532a010e0eac8df5519ab4f717ec663ff64445da Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Mon, 3 Apr 2017 16:01:21 -0400 Subject: [PATCH] Parse LastModified date without requiring global timezone --- lib/HTTP/ConditionalGet.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/HTTP/ConditionalGet.php b/lib/HTTP/ConditionalGet.php index 0f251ee..bbfe089 100644 --- a/lib/HTTP/ConditionalGet.php +++ b/lib/HTTP/ConditionalGet.php @@ -360,7 +360,10 @@ class HTTP_ConditionalGet } // strip off IE's extra data (semicolon) list($ifModifiedSince) = explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE'], 2); - if (strtotime($ifModifiedSince) >= $this->_lmTime) { + + $date = new DateTime($ifModifiedSince, new DateTimeZone('UTC')); + + if ($date->getTimestamp() >= $this->_lmTime) { // Apache 2.2's behavior. If there was no ETag match, send the // non-encoded version of the ETag value. $this->_headers['ETag'] = $this->normalizeEtag($this->_etag);