1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-12 09:05:08 +02:00

Parse LastModified date without requiring global timezone

Fixes #568
This commit is contained in:
Steve Clay
2017-02-07 15:33:18 -05:00
parent 234b9459ca
commit 176fb1084f

View File

@@ -355,7 +355,10 @@ class HTTP_ConditionalGet {
} }
// strip off IE's extra data (semicolon) // strip off IE's extra data (semicolon)
list($ifModifiedSince) = explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE'], 2); 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 // Apache 2.2's behavior. If there was no ETag match, send the
// non-encoded version of the ETag value. // non-encoded version of the ETag value.
$this->_headers['ETag'] = $this->normalizeEtag($this->_etag); $this->_headers['ETag'] = $this->normalizeEtag($this->_etag);