diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index 45459d84b..5e1df6df6 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -1162,15 +1162,14 @@ 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; + $checks = array(); if ($responseTag = $this->etag()) { - $etagMatches = in_array('*', $etags) || in_array($responseTag, $etags); + $checks[] = in_array('*', $etags) || in_array($responseTag, $etags); } if ($modifiedSince) { - $timeMatches = strtotime($this->modified()) === strtotime($modifiedSince); + $checks[] = strtotime($this->modified()) === strtotime($modifiedSince); } - $checks = compact('etagMatches', 'timeMatches'); - if (empty(array_filter($checks))) { + if (empty($checks)) { return false; } $notModified = !in_array(false, $checks, true);