updated composer
This commit is contained in:
21
vendor/symfony/http-foundation/HeaderUtils.php
vendored
21
vendor/symfony/http-foundation/HeaderUtils.php
vendored
@@ -146,7 +146,7 @@ class HeaderUtils
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a HTTP Content-Disposition field-value.
|
||||
* Generates an HTTP Content-Disposition field-value.
|
||||
*
|
||||
* @param string $disposition One of "inline" or "attachment"
|
||||
* @param string $filename A unicode string
|
||||
@@ -251,17 +251,23 @@ class HeaderUtils
|
||||
return $query;
|
||||
}
|
||||
|
||||
private static function groupParts(array $matches, string $separators): array
|
||||
private static function groupParts(array $matches, string $separators, bool $first = true): array
|
||||
{
|
||||
$separator = $separators[0];
|
||||
$partSeparators = substr($separators, 1);
|
||||
|
||||
$i = 0;
|
||||
$partMatches = [];
|
||||
$previousMatchWasSeparator = false;
|
||||
foreach ($matches as $match) {
|
||||
if (isset($match['separator']) && $match['separator'] === $separator) {
|
||||
if (!$first && $previousMatchWasSeparator && isset($match['separator']) && $match['separator'] === $separator) {
|
||||
$previousMatchWasSeparator = true;
|
||||
$partMatches[$i][] = $match;
|
||||
} elseif (isset($match['separator']) && $match['separator'] === $separator) {
|
||||
$previousMatchWasSeparator = true;
|
||||
++$i;
|
||||
} else {
|
||||
$previousMatchWasSeparator = false;
|
||||
$partMatches[$i][] = $match;
|
||||
}
|
||||
}
|
||||
@@ -269,12 +275,19 @@ class HeaderUtils
|
||||
$parts = [];
|
||||
if ($partSeparators) {
|
||||
foreach ($partMatches as $matches) {
|
||||
$parts[] = self::groupParts($matches, $partSeparators);
|
||||
$parts[] = self::groupParts($matches, $partSeparators, false);
|
||||
}
|
||||
} else {
|
||||
foreach ($partMatches as $matches) {
|
||||
$parts[] = self::unquote($matches[0][0]);
|
||||
}
|
||||
|
||||
if (!$first && 2 < \count($parts)) {
|
||||
$parts = [
|
||||
$parts[0],
|
||||
implode($separator, \array_slice($parts, 1)),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $parts;
|
||||
|
||||
Reference in New Issue
Block a user