Skip to content

Commit cf92ef4

Browse files
committed
Merge branch 'release/2.4.0'
2 parents 1f8a3bd + a9cf4b4 commit cf92ef4

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## 2.4.0 - 2025-04-10
10+
### Changed
11+
- Add support for php-weasyprint 2.0
12+
### Security
13+
- Update `symfony/http-foundation` minimal version to mitigate [CVE-2024-50345](https://github.com/advisories/GHSA-mrqx-rp3w-jpjp)
14+
915
## 2.3.0 - 2024-11-04
1016
### Added
1117
- Added support for PHP 8.4

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
],
1818
"require": {
1919
"php": "7.4.* || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*",
20-
"pontedilana/php-weasyprint": "^1.0",
20+
"pontedilana/php-weasyprint": "^1.0 || ^2.0",
2121
"symfony/config": "^5.4 || ^6.3 || ^7.0",
2222
"symfony/dependency-injection": "^5.4 || ^6.3 || ^7.0",
23-
"symfony/http-foundation": "^5.4 || ^6.3 || ^7.0",
23+
"symfony/http-foundation": "^5.4.46 || ^6.4.14 || ^7.1.7",
2424
"symfony/http-kernel": "^5.4 || ^6.3 || ^7.0"
2525
},
2626
"require-dev": {

src/WeasyPrint/Response/WeasyPrintResponse.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Pontedilana\WeasyprintBundle\WeasyPrint\Response;
44

55
use Symfony\Component\HttpFoundation\Response as Base;
6-
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
76

87
class WeasyPrintResponse extends Base
98
{
@@ -18,14 +17,6 @@ public function __construct(
1817
int $status = 200,
1918
array $headers = []
2019
) {
21-
$contentDispositionDirectives = [
22-
ResponseHeaderBag::DISPOSITION_INLINE,
23-
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
24-
];
25-
if (!\in_array($contentDisposition, $contentDispositionDirectives, true)) {
26-
throw new \InvalidArgumentException(\sprintf('Expected one of the following directives: "%s", but "%s" given.', implode('", "', $contentDispositionDirectives), $contentDisposition));
27-
}
28-
2920
parent::__construct($content, $status, $headers);
3021
$this->headers->add(['Content-Type' => $contentType]);
3122
$this->headers->add(['Content-Disposition' => $this->headers->makeDisposition($contentDisposition, $fileName)]);

tests/WeasyPrint/Response/WeasyPrintResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function testExceptionMessage(): void
1212
try {
1313
new WeasyPrintResponse('', 'test.pdf', 'application/pdf', 'foo');
1414
} catch (\InvalidArgumentException $e) {
15-
$this->assertSame('Expected one of the following directives: "inline", "attachment", but "foo" given.', $e->getMessage());
15+
$this->assertSame('The disposition must be either "attachment" or "inline".', $e->getMessage());
1616
}
1717
}
1818
}

0 commit comments

Comments
 (0)