From 176fb1084f209974acfa9d2e074e1e7055a151b1 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Tue, 7 Feb 2017 15:33:18 -0500 Subject: [PATCH] Parse LastModified date without requiring global timezone Fixes #568 --- min/lib/HTTP/ConditionalGet.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/min/lib/HTTP/ConditionalGet.php b/min/lib/HTTP/ConditionalGet.php index 93b7e75..41dfd2e 100644 --- a/min/lib/HTTP/ConditionalGet.php +++ b/min/lib/HTTP/ConditionalGet.php @@ -355,7 +355,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);