diff vendor/symfony/http-foundation/Cookie.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children
line wrap: on
line diff
--- a/vendor/symfony/http-foundation/Cookie.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/symfony/http-foundation/Cookie.php	Thu Feb 28 13:21:36 2019 +0000
@@ -41,7 +41,7 @@
      */
     public static function fromString($cookie, $decode = false)
     {
-        $data = array(
+        $data = [
             'expires' => 0,
             'path' => '/',
             'domain' => null,
@@ -49,7 +49,7 @@
             'httponly' => false,
             'raw' => !$decode,
             'samesite' => null,
-        );
+        ];
         foreach (explode(';', $cookie) as $part) {
             if (false === strpos($part, '=')) {
                 $key = trim($part);
@@ -128,7 +128,7 @@
             $sameSite = strtolower($sameSite);
         }
 
-        if (!in_array($sameSite, array(self::SAMESITE_LAX, self::SAMESITE_STRICT, null), true)) {
+        if (!\in_array($sameSite, [self::SAMESITE_LAX, self::SAMESITE_STRICT, null], true)) {
             throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.');
         }
 
@@ -266,7 +266,7 @@
      */
     public function isCleared()
     {
-        return $this->expire < time();
+        return 0 !== $this->expire && $this->expire < time();
     }
 
     /**