Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 7b95fa7

Browse files
committed
use max(0, (int) $maxAge) to handle < 0 maxage
1 parent b762d04 commit 7b95fa7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Header/SetCookie.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,7 @@ public function setMaxAge($maxAge)
352352
return $this;
353353
}
354354

355-
$maxAge = (int) $maxAge;
356-
if ($maxAge < 0) {
357-
$maxAge = 0;
358-
}
359-
360-
$this->maxAge = $maxAge;
355+
$this->maxAge = max(0, (int) $maxAge);
361356
return $this;
362357
}
363358

0 commit comments

Comments
 (0)