Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"stecman/symfony-console-completion": "^0.13.0",
"symfony/console": "^6.4.17",
"symfony/event-dispatcher": "^6.4.13",
"symfony/http-foundation": "^6.4.18",
"symfony/http-foundation": "^6.4.29",
"symfony/mailer": "^6.4",
"symfony/polyfill-intl-grapheme": "^1.31.0",
"symfony/polyfill-intl-normalizer": "^1.31.0",
Expand Down
18 changes: 11 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4799,17 +4799,17 @@
},
{
"name": "symfony/http-foundation",
"version": "v6.4.18",
"version_normalized": "6.4.18.0",
"version": "v6.4.29",
"version_normalized": "6.4.29.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "d0492d6217e5ab48f51fca76f64cf8e78919d0db"
"reference": "b03d11e015552a315714c127d8d1e0f9e970ec88"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0492d6217e5ab48f51fca76f64cf8e78919d0db",
"reference": "d0492d6217e5ab48f51fca76f64cf8e78919d0db",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/b03d11e015552a315714c127d8d1e0f9e970ec88",
"reference": "b03d11e015552a315714c127d8d1e0f9e970ec88",
"shasum": ""
},
"require": {
Expand All @@ -4831,7 +4831,7 @@
"symfony/mime": "^5.4|^6.0|^7.0",
"symfony/rate-limiter": "^5.4|^6.0|^7.0"
},
"time": "2025-01-09T15:48:56+00:00",
"time": "2025-11-08T16:40:12+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down Expand Up @@ -4859,7 +4859,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-foundation/tree/v6.4.18"
"source": "https://github.com/symfony/http-foundation/tree/v6.4.29"
},
"funding": [
{
Expand All @@ -4870,6 +4870,10 @@
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
Expand Down
6 changes: 3 additions & 3 deletions composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,9 @@
),
),
'symfony/http-foundation' => array(
'pretty_version' => 'v6.4.18',
'version' => '6.4.18.0',
'reference' => 'd0492d6217e5ab48f51fca76f64cf8e78919d0db',
'pretty_version' => 'v6.4.29',
'version' => '6.4.29.0',
'reference' => 'b03d11e015552a315714c127d8d1e0f9e970ec88',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/http-foundation',
'aliases' => array(),
Expand Down
8 changes: 4 additions & 4 deletions symfony/http-foundation/BinaryFileResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function setContentDisposition(string $disposition, string $filename = ''
for ($i = 0, $filenameLength = mb_strlen($filename, $encoding); $i < $filenameLength; ++$i) {
$char = mb_substr($filename, $i, 1, $encoding);

if ('%' === $char || \ord($char) < 32 || \ord($char) > 126) {
if ('%' === $char || \ord($char[0]) < 32 || \ord($char[0]) > 126) {
$filenameFallback .= '_';
} else {
$filenameFallback .= $char;
Expand Down Expand Up @@ -229,7 +229,7 @@ public function prepare(Request $request): static
$path = $location.substr($path, \strlen($pathPrefix));
// Only set X-Accel-Redirect header if a valid URI can be produced
// as nginx does not serve arbitrary file paths.
$this->headers->set($type, $path);
$this->headers->set($type, rawurlencode($path));
$this->maxlen = 0;
break;
}
Expand Down Expand Up @@ -259,13 +259,13 @@ public function prepare(Request $request): static
$end = min($end, $fileSize - 1);
if ($start < 0 || $start > $end) {
$this->setStatusCode(416);
$this->headers->set('Content-Range', sprintf('bytes */%s', $fileSize));
$this->headers->set('Content-Range', \sprintf('bytes */%s', $fileSize));
} elseif ($end - $start < $fileSize - 1) {
$this->maxlen = $end < $fileSize ? $end - $start + 1 : -1;
$this->offset = $start;

$this->setStatusCode(206);
$this->headers->set('Content-Range', sprintf('bytes %s-%s/%s', $start, $end, $fileSize));
$this->headers->set('Content-Range', \sprintf('bytes %s-%s/%s', $start, $end, $fileSize));
$this->headers->set('Content-Length', $end - $start + 1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions symfony/http-foundation/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function __construct(string $name, ?string $value = null, int|string|\Dat
{
// from PHP source code
if ($raw && false !== strpbrk($name, self::RESERVED_CHARS_LIST)) {
throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name));
throw new \InvalidArgumentException(\sprintf('The cookie name "%s" contains invalid characters.', $name));
}

if (empty($name)) {
Expand Down Expand Up @@ -211,7 +211,7 @@ public function withHttpOnly(bool $httpOnly = true): static
public function withRaw(bool $raw = true): static
{
if ($raw && false !== strpbrk($this->name, self::RESERVED_CHARS_LIST)) {
throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $this->name));
throw new \InvalidArgumentException(\sprintf('The cookie name "%s" contains invalid characters.', $this->name));
}

$cookie = clone $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class AccessDeniedException extends FileException
{
public function __construct(string $path)
{
parent::__construct(sprintf('The file %s could not be accessed', $path));
parent::__construct(\sprintf('The file %s could not be accessed', $path));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class FileNotFoundException extends FileException
{
public function __construct(string $path)
{
parent::__construct(sprintf('The file "%s" does not exist', $path));
parent::__construct(\sprintf('The file "%s" does not exist', $path));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class UnexpectedTypeException extends FileException
{
public function __construct(mixed $value, string $expectedType)
{
parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, get_debug_type($value)));
parent::__construct(\sprintf('Expected argument of type %s, %s given', $expectedType, get_debug_type($value)));
}
}
8 changes: 4 additions & 4 deletions symfony/http-foundation/File/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function move(string $directory, ?string $name = null): self
restore_error_handler();
}
if (!$renamed) {
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error)));
throw new FileException(\sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error)));
}

@chmod($target, 0666 & ~umask());
Expand All @@ -106,7 +106,7 @@ public function getContent(): string
$content = file_get_contents($this->getPathname());

if (false === $content) {
throw new FileException(sprintf('Could not get the content of the file "%s".', $this->getPathname()));
throw new FileException(\sprintf('Could not get the content of the file "%s".', $this->getPathname()));
}

return $content;
Expand All @@ -116,10 +116,10 @@ protected function getTargetFile(string $directory, ?string $name = null): self
{
if (!is_dir($directory)) {
if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) {
throw new FileException(sprintf('Unable to create the "%s" directory.', $directory));
throw new FileException(\sprintf('Unable to create the "%s" directory.', $directory));
}
} elseif (!is_writable($directory)) {
throw new FileException(sprintf('Unable to write in the "%s" directory.', $directory));
throw new FileException(\sprintf('Unable to write in the "%s" directory.', $directory));
}

$target = rtrim($directory, '/\\').\DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name));
Expand Down
4 changes: 2 additions & 2 deletions symfony/http-foundation/File/UploadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function move(string $directory, ?string $name = null): File
restore_error_handler();
}
if (!$moved) {
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error)));
throw new FileException(\sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error)));
}

@chmod($target, 0666 & ~umask());
Expand Down Expand Up @@ -264,6 +264,6 @@ public function getErrorMessage(): string
$maxFilesize = \UPLOAD_ERR_INI_SIZE === $errorCode ? self::getMaxFilesize() / 1024 : 0;
$message = $errors[$errorCode] ?? 'The file "%s" was not uploaded due to an unknown error.';

return sprintf($message, $this->getClientOriginalName(), $maxFilesize);
return \sprintf($message, $this->getClientOriginalName(), $maxFilesize);
}
}
4 changes: 2 additions & 2 deletions symfony/http-foundation/HeaderBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __toString(): string
foreach ($headers as $name => $values) {
$name = ucwords($name, '-');
foreach ($values as $value) {
$content .= sprintf("%-{$max}s %s\r\n", $name.':', $value);
$content .= \sprintf("%-{$max}s %s\r\n", $name.':', $value);
}
}

Expand Down Expand Up @@ -204,7 +204,7 @@ public function getDate(string $key, ?\DateTimeInterface $default = null): ?\Dat
}

if (false === $date = \DateTimeImmutable::createFromFormat(\DATE_RFC2822, $value)) {
throw new \RuntimeException(sprintf('The "%s" HTTP header is not parseable (%s).', $key, $value));
throw new \RuntimeException(\sprintf('The "%s" HTTP header is not parseable (%s).', $key, $value));
}

return $date;
Expand Down
2 changes: 1 addition & 1 deletion symfony/http-foundation/HeaderUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static function unquote(string $s): string
public static function makeDisposition(string $disposition, string $filename, string $filenameFallback = ''): string
{
if (!\in_array($disposition, [self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE])) {
throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE));
throw new \InvalidArgumentException(\sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE));
}

if ('' === $filenameFallback) {
Expand Down
10 changes: 5 additions & 5 deletions symfony/http-foundation/InputBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ final class InputBag extends ParameterBag
public function get(string $key, mixed $default = null): string|int|float|bool|null
{
if (null !== $default && !\is_scalar($default) && !$default instanceof \Stringable) {
throw new \InvalidArgumentException(sprintf('Expected a scalar value as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($default)));
throw new \InvalidArgumentException(\sprintf('Expected a scalar value as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($default)));
}

$value = parent::get($key, $this);

if (null !== $value && $this !== $value && !\is_scalar($value) && !$value instanceof \Stringable) {
throw new BadRequestException(sprintf('Input value "%s" contains a non-scalar value.', $key));
throw new BadRequestException(\sprintf('Input value "%s" contains a non-scalar value.', $key));
}

return $this === $value ? $default : $value;
Expand Down Expand Up @@ -68,7 +68,7 @@ public function add(array $inputs = []): void
public function set(string $key, mixed $value): void
{
if (null !== $value && !\is_scalar($value) && !\is_array($value) && !$value instanceof \Stringable) {
throw new \InvalidArgumentException(sprintf('Expected a scalar, or an array as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($value)));
throw new \InvalidArgumentException(\sprintf('Expected a scalar, or an array as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($value)));
}

$this->parameters[$key] = $value;
Expand Down Expand Up @@ -112,11 +112,11 @@ public function filter(string $key, mixed $default = null, int $filter = \FILTER
}

if (\is_array($value) && !(($options['flags'] ?? 0) & (\FILTER_REQUIRE_ARRAY | \FILTER_FORCE_ARRAY))) {
throw new BadRequestException(sprintf('Input value "%s" contains an array, but "FILTER_REQUIRE_ARRAY" or "FILTER_FORCE_ARRAY" flags were not set.', $key));
throw new BadRequestException(\sprintf('Input value "%s" contains an array, but "FILTER_REQUIRE_ARRAY" or "FILTER_FORCE_ARRAY" flags were not set.', $key));
}

if ((\FILTER_CALLBACK & $filter) && !(($options['options'] ?? null) instanceof \Closure)) {
throw new \InvalidArgumentException(sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null)));
throw new \InvalidArgumentException(\sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null)));
}

$options['flags'] ??= 0;
Expand Down
4 changes: 2 additions & 2 deletions symfony/http-foundation/IpUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function checkIp4(string $requestIp, string $ip): bool
return self::setCacheResult($cacheKey, false);
}

return self::setCacheResult($cacheKey, 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask));
return self::setCacheResult($cacheKey, 0 === substr_compare(\sprintf('%032b', ip2long($requestIp)), \sprintf('%032b', ip2long($address)), 0, $netmask));
}

/**
Expand Down Expand Up @@ -182,7 +182,7 @@ public static function checkIp6(string $requestIp, string $ip): bool
*/
public static function anonymize(string $ip): string
{
/**
/*
* If the IP contains a % symbol, then it is a local-link address with scoping according to RFC 4007
* In that case, we only care about the part before the % symbol, as the following functions, can only work with
* the IP address itself. As the scope can leak information (containing interface name), we do not want to
Expand Down
4 changes: 2 additions & 2 deletions symfony/http-foundation/JsonResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(mixed $data = null, int $status = 200, array $header
parent::__construct('', $status, $headers);

if ($json && !\is_string($data) && !is_numeric($data) && !\is_callable([$data, '__toString'])) {
throw new \TypeError(sprintf('"%s": If $json is set to true, argument $data must be a string or object implementing __toString(), "%s" given.', __METHOD__, get_debug_type($data)));
throw new \TypeError(\sprintf('"%s": If $json is set to true, argument $data must be a string or object implementing __toString(), "%s" given.', __METHOD__, get_debug_type($data)));
}

$data ??= new \ArrayObject();
Expand Down Expand Up @@ -176,7 +176,7 @@ protected function update(): static
// Not using application/javascript for compatibility reasons with older browsers.
$this->headers->set('Content-Type', 'text/javascript');

return $this->setContent(sprintf('/**/%s(%s);', $this->callback, $this->data));
return $this->setContent(\sprintf('/**/%s(%s);', $this->callback, $this->data));
}

// Only set the header when there is none or when it equals 'text/javascript' (from a previous update with callback)
Expand Down
Loading