Skip to content
Permalink
Browse files

Rebuilds the solution

  • Loading branch information...
joezidell-saleswarp committed Aug 22, 2018
1 parent 1fca92f commit 013ecc3f9ff1772ebfa5b3de64211e8d3694c724
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/Cake/Network/CakeResponse.php
@@ -1162,15 +1162,14 @@ public function length($bytes = null) {
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);

0 comments on commit 013ecc3

Please sign in to comment.
You can’t perform that action at this time.