Skip to content

Commit 8af585b

Browse files
Merge pull request #2962 from coreshop/copilot/fix-information-exposure-issue
Fix information exposure in OrderInvoiceController and OrderShipmentController
2 parents d7a1385 + de3345e commit 8af585b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/CoreShop/Bundle/OrderBundle/Controller/OrderInvoiceController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ public function renderAction(Request $request): Response
187187
'Content-Disposition' => 'inline; filename="invoice-' . $invoice->getId() . '.pdf"',
188188
];
189189
} catch (\Exception $e) {
190-
$responseData = '<strong>' . $e->getMessage() . '</strong><br>trace: ' . $e->getTraceAsString();
191-
$header = ['Content-Type' => 'text/html'];
190+
return new Response('An error occurred while rendering the invoice.', 500, ['Content-Type' => 'text/html']);
192191
}
193192

194193
return new Response($responseData, 200, $header);

src/CoreShop/Bundle/OrderBundle/Controller/OrderShipmentController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,7 @@ public function renderAction(Request $request): Response
183183
'Content-Disposition' => 'inline; filename="shipment-' . $shipment->getId() . '.pdf"',
184184
];
185185
} catch (\Exception $e) {
186-
$responseData = '<strong>' . $e->getMessage() . '</strong><br>trace: ' . $e->getTraceAsString();
187-
$header = ['Content-Type' => 'text/html'];
186+
return new Response('An error occurred while rendering the shipment.', 500, ['Content-Type' => 'text/html']);
188187
}
189188

190189
return new Response($responseData, 200, $header);

0 commit comments

Comments
 (0)