1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-18 20:01:21 +02:00

Parse LastModified date without requiring global timezone

This commit is contained in:
Steve Clay
2017-04-03 16:01:21 -04:00
parent d95690abc9
commit 532a010e0e

View File

@@ -360,7 +360,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);