comparison vendor/symfony/http-foundation/Cookie.php @ 12:7a779792577d

Update Drupal core to v8.4.5 (via Composer)
author Chris Cannam
date Fri, 23 Feb 2018 15:52:07 +0000
parents 4c8ae668cc8c
children 1fec387a4317
comparison
equal deleted inserted replaced
11:bfffd8d7479a 12:7a779792577d
75 $this->path = empty($path) ? '/' : $path; 75 $this->path = empty($path) ? '/' : $path;
76 $this->secure = (bool) $secure; 76 $this->secure = (bool) $secure;
77 $this->httpOnly = (bool) $httpOnly; 77 $this->httpOnly = (bool) $httpOnly;
78 $this->raw = (bool) $raw; 78 $this->raw = (bool) $raw;
79 79
80 if (null !== $sameSite) {
81 $sameSite = strtolower($sameSite);
82 }
83
80 if (!in_array($sameSite, array(self::SAMESITE_LAX, self::SAMESITE_STRICT, null), true)) { 84 if (!in_array($sameSite, array(self::SAMESITE_LAX, self::SAMESITE_STRICT, null), true)) {
81 throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.'); 85 throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.');
82 } 86 }
83 87
84 $this->sameSite = $sameSite; 88 $this->sameSite = $sameSite;
94 $str = ($this->isRaw() ? $this->getName() : urlencode($this->getName())).'='; 98 $str = ($this->isRaw() ? $this->getName() : urlencode($this->getName())).'=';
95 99
96 if ('' === (string) $this->getValue()) { 100 if ('' === (string) $this->getValue()) {
97 $str .= 'deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001); 101 $str .= 'deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001);
98 } else { 102 } else {
99 $str .= $this->isRaw() ? $this->getValue() : urlencode($this->getValue()); 103 $str .= $this->isRaw() ? $this->getValue() : rawurlencode($this->getValue());
100 104
101 if (0 !== $this->getExpiresTime()) { 105 if (0 !== $this->getExpiresTime()) {
102 $str .= '; expires='.gmdate('D, d-M-Y H:i:s T', $this->getExpiresTime()); 106 $str .= '; expires='.gmdate('D, d-M-Y H:i:s T', $this->getExpiresTime());
103 } 107 }
104 } 108 }