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

Commit 8480fd6

Browse files
samsonasikXerkus
authored andcommitted
use max(0, (int) $maxAge) to handle < 0 maxage
1 parent 464c5c7 commit 8480fd6

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
@@ -350,12 +350,7 @@ public function setMaxAge($maxAge)
350350
return $this;
351351
}
352352

353-
$maxAge = (int) $maxAge;
354-
if ($maxAge < 0) {
355-
$maxAge = 0;
356-
}
357-
358-
$this->maxAge = $maxAge;
353+
$this->maxAge = max(0, (int) $maxAge);
359354
return $this;
360355
}
361356

0 commit comments

Comments
 (0)