Skip to content

Commit 1a79975

Browse files
steeffabpot
authored andcommitted
Fix binary operation +, - or * on string
By type casting to integer.
1 parent fc31f88 commit 1a79975

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

HttpCache/ResponseCacheStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function add(Response $response)
8585
$this->storeRelativeAgeDirective('s-maxage', $response->headers->getCacheControlDirective('s-maxage') ?: $response->headers->getCacheControlDirective('max-age'), $age);
8686

8787
$expires = $response->getExpires();
88-
$expires = null !== $expires ? $expires->format('U') - $response->getDate()->format('U') : null;
88+
$expires = null !== $expires ? (int) $expires->format('U') - (int) $response->getDate()->format('U') : null;
8989
$this->storeRelativeAgeDirective('expires', $expires >= 0 ? $expires : null, 0);
9090
}
9191

0 commit comments

Comments
 (0)