diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index cae6b34a5..63e827034 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -1162,15 +1162,13 @@ class CakeResponse { public function checkNotModified(CakeRequest $request) { $etags = preg_split('/\s*,\s*/', $request->header('If-None-Match'), null, PREG_SPLIT_NO_EMPTY); $modifiedSince = $request->header('If-Modified-Since'); + $etagMatches = $timeMatches = false; if ($responseTag = $this->etag()) { $etagMatches = in_array('*', $etags) || in_array($responseTag, $etags); } else { - $etagMatches = false; } if ($modifiedSince) { $timeMatches = strtotime($this->modified()) === strtotime($modifiedSince); - } else { - $timeMatches = false; } $checks = compact('etagMatches', 'timeMatches'); if (empty($checks)) {