From 77104bdc370d2e2cc83adf67fc6d91554cd7c364 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 10 Sep 2017 12:43:38 +0200 Subject: [PATCH] [ticket/15298] Makes sure CLI exceptions are never suppressed by Symfony PHPBB3-15298 --- phpBB/phpbb/console/exception_subscriber.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/phpbb/console/exception_subscriber.php b/phpBB/phpbb/console/exception_subscriber.php index 15b317f349..8220d244fa 100644 --- a/phpBB/phpbb/console/exception_subscriber.php +++ b/phpBB/phpbb/console/exception_subscriber.php @@ -52,6 +52,12 @@ class exception_subscriber implements EventSubscriberInterface $event->setError($exception); } + + // If the exception has an exit code of 0, Symfony will suppress it by default which we don't want + if ($event->getExitCode() === 0 && $original_exception->getCode() === 0) + { + $event->setExitCode(1); + } } static public function getSubscribedEvents()