Skip to content
Permalink
Browse files

Combine variable defaults

  • Loading branch information...
joezidell-saleswarp committed Aug 21, 2018
1 parent a4e71b3 commit 8e7bc7701c7fe7d2a90d7e9a3aff55d3bb952954
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/Cake/Network/CakeResponse.php
@@ -1162,15 +1162,13 @@ 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;
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)) {

0 comments on commit 8e7bc77

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