Skip to content

Commit 3ae95a6

Browse files
committed
Handle ResponseException explicitly in InsertTagsListener.
Do not catch ResponseException as they might provide an redirect or downloaded file.
1 parent 02243df commit 3ae95a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/CoreBundle/EventListener/InsertTagsListener.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
namespace MetaModels\CoreBundle\EventListener;
2626

27+
use Contao\CoreBundle\Exception\ResponseException;
2728
use Contao\StringUtil;
2829
use Contao\Input;
2930
use Doctrine\DBAL\Connection;
@@ -176,6 +177,10 @@ public function __invoke(string $insertTag): bool|int|string
176177
default:
177178
}
178179
} catch (\Exception $exc) {
180+
if ($exc instanceof ResponseException) {
181+
throw $exc;
182+
}
183+
179184
$this->logger?->error(
180185
'Error by replace tags: ' . $exc->getMessage() . ' | ' . __CLASS__ . ' | ' . __FUNCTION__
181186
);

0 commit comments

Comments
 (0)