1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-31 01:29:56 +02:00

Merge pull request #570 from mrclay/default_tz

Parse LastModified date without requiring global timezone
This commit is contained in:
Steve Clay
2017-03-13 11:07:16 -04:00
committed by GitHub

View File

@@ -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);