mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 13:09:53 +09:00
update to laravel 5.7 and try getting autologin saved
This commit is contained in:
38
vendor/symfony/http-foundation/HeaderBag.php
vendored
38
vendor/symfony/http-foundation/HeaderBag.php
vendored
@@ -46,7 +46,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
$max = max(array_map('strlen', array_keys($headers))) + 1;
|
||||
$content = '';
|
||||
foreach ($headers as $name => $values) {
|
||||
$name = implode('-', array_map('ucfirst', explode('-', $name)));
|
||||
$name = ucwords($name, '-');
|
||||
foreach ($values as $value) {
|
||||
$content .= sprintf("%-{$max}s %s\r\n", $name.':', $value);
|
||||
}
|
||||
@@ -101,11 +101,11 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Returns a header value by name.
|
||||
*
|
||||
* @param string $key The header name
|
||||
* @param string|string[] $default The default value
|
||||
* @param bool $first Whether to return the first value or all header values
|
||||
* @param string $key The header name
|
||||
* @param string|string[]|null $default The default value
|
||||
* @param bool $first Whether to return the first value or all header values
|
||||
*
|
||||
* @return string|string[] The first header value or default value if $first is true, an array of values otherwise
|
||||
* @return string|string[]|null The first header value or default value if $first is true, an array of values otherwise
|
||||
*/
|
||||
public function get($key, $default = null, $first = true)
|
||||
{
|
||||
@@ -181,7 +181,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function contains($key, $value)
|
||||
{
|
||||
return in_array($value, $this->get($key, null, false));
|
||||
return \in_array($value, $this->get($key, null, false));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -206,7 +206,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
* @param string $key The parameter key
|
||||
* @param \DateTime $default The default value
|
||||
*
|
||||
* @return null|\DateTime The parsed DateTime or the default value if the header does not exist
|
||||
* @return \DateTime|null The parsed DateTime or the default value if the header does not exist
|
||||
*
|
||||
* @throws \RuntimeException When the HTTP header is not parseable
|
||||
*/
|
||||
@@ -289,26 +289,14 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->headers);
|
||||
return \count($this->headers);
|
||||
}
|
||||
|
||||
protected function getCacheControlHeader()
|
||||
{
|
||||
$parts = array();
|
||||
ksort($this->cacheControl);
|
||||
foreach ($this->cacheControl as $key => $value) {
|
||||
if (true === $value) {
|
||||
$parts[] = $key;
|
||||
} else {
|
||||
if (preg_match('#[^a-zA-Z0-9._-]#', $value)) {
|
||||
$value = '"'.$value.'"';
|
||||
}
|
||||
|
||||
$parts[] = "$key=$value";
|
||||
}
|
||||
}
|
||||
|
||||
return implode(', ', $parts);
|
||||
return HeaderUtils::toString($this->cacheControl, ',');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,12 +308,8 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
protected function parseCacheControl($header)
|
||||
{
|
||||
$cacheControl = array();
|
||||
preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $match) {
|
||||
$cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true);
|
||||
}
|
||||
$parts = HeaderUtils::split($header, ',=');
|
||||
|
||||
return $cacheControl;
|
||||
return HeaderUtils::combine($parts);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user