From: Johan Cwiklinski Date: Sat, 16 Nov 2019 18:46:47 +0000 (+0100) Subject: Fix contributions PDF content type; refs #1271 X-Git-Tag: 0.9.3~27 X-Git-Url: https://git.agnieray.net/?a=commitdiff_plain;h=9a124c49b3aae52c5f7bae88fa8849b1a0b4436d;p=galette.git Fix contributions PDF content type; refs #1271 --- diff --git a/galette/includes/routes/contributions.routes.php b/galette/includes/routes/contributions.routes.php index fa802e4a0..6d419c2d3 100644 --- a/galette/includes/routes/contributions.routes.php +++ b/galette/includes/routes/contributions.routes.php @@ -1254,6 +1254,10 @@ $app->get( function ($request, $response, $args) { $contribution = new Contribution($this->zdb, $this->login, (int)$args['id']); $pdf = new PdfContribution($contribution, $this->zdb, $this->preferences); - $pdf->download(); + + $response = $this->response->withHeader('Content-type', 'application/pdf') + ->withHeader('Content-Disposition', 'attachment;filename="' . $pdf->getFileName() . '"'); + $response->write($pdf->download()); + return $response; } )->setName('printContribution')->add($authenticate);