N°8017 - Security - dependabot - Symfony's VarDumper vulnerable to un… (#731)

Upgrade all Symfony components to last security fix (~6.4.0)
This commit is contained in:
Benjamin Dalsass
2025-08-06 08:54:56 +02:00
committed by GitHub
parent 603340b852
commit cdbcd14767
608 changed files with 5020 additions and 3793 deletions

View File

@@ -31,7 +31,7 @@ final class BodyRenderer implements BodyRendererInterface
private HtmlToTextConverterInterface $converter;
private ?LocaleSwitcher $localeSwitcher = null;
public function __construct(Environment $twig, array $context = [], HtmlToTextConverterInterface $converter = null, LocaleSwitcher $localeSwitcher = null)
public function __construct(Environment $twig, array $context = [], ?HtmlToTextConverterInterface $converter = null, ?LocaleSwitcher $localeSwitcher = null)
{
$this->twig = $twig;
$this->context = $context;
@@ -45,7 +45,7 @@ final class BodyRenderer implements BodyRendererInterface
return;
}
if (null === $message->getTextTemplate() && null === $message->getHtmlTemplate()) {
if ($message->isRendered()) {
// email has already been rendered
return;
}

View File

@@ -42,7 +42,7 @@ class NotificationEmail extends TemplatedEmail
];
private bool $rendered = false;
public function __construct(Headers $headers = null, AbstractPart $body = null)
public function __construct(?Headers $headers = null, ?AbstractPart $body = null)
{
$missingPackages = [];
if (!class_exists(CssInlinerExtension::class)) {
@@ -63,7 +63,7 @@ class NotificationEmail extends TemplatedEmail
/**
* Creates a NotificationEmail instance that is appropriate to send to normal (non-admin) users.
*/
public static function asPublicEmail(Headers $headers = null, AbstractPart $body = null): self
public static function asPublicEmail(?Headers $headers = null, ?AbstractPart $body = null): self
{
$email = new static($headers, $body);
$email->markAsPublic();
@@ -174,6 +174,26 @@ class NotificationEmail extends TemplatedEmail
return '@email/'.$this->theme.'/notification/body.html.twig';
}
/**
* @return $this
*/
public function context(array $context): static
{
$parentContext = [];
foreach ($context as $key => $value) {
if (\array_key_exists($key, $this->context)) {
$this->context[$key] = $value;
} else {
$parentContext[$key] = $value;
}
}
parent::context($parentContext);
return $this;
}
public function getContext(): array
{
return array_merge($this->context, parent::getContext());

View File

@@ -43,7 +43,7 @@ final class WrappedTemplatedEmail
* @param string|null $contentType The media type (i.e. MIME type) of the image file (e.g. 'image/png').
* Some email clients require this to display embedded images.
*/
public function image(string $image, string $contentType = null): string
public function image(string $image, ?string $contentType = null): string
{
$file = $this->twig->getLoader()->getSourceContext($image);
$body = $file->getPath() ? new File($file->getPath()) : $file->getCode();
@@ -59,7 +59,7 @@ final class WrappedTemplatedEmail
* @param string|null $contentType The media type (i.e. MIME type) of the file (e.g. 'application/pdf').
* Some email clients require this to display attached files.
*/
public function attach(string $file, string $name = null, string $contentType = null): void
public function attach(string $file, ?string $name = null, ?string $contentType = null): void
{
$file = $this->twig->getLoader()->getSourceContext($file);
$body = $file->getPath() ? new File($file->getPath()) : $file->getCode();