Browse Source

Correctif

develop
Fabien Normand 3 years ago
parent
commit
f361cbebc3
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      Controller/ErrorController.php

+ 8
- 2
Controller/ErrorController.php View File

->from('nepasrepondre@laclic.fr') ->from('nepasrepondre@laclic.fr')
->to($mailDebug) ->to($mailDebug)
->subject( ->subject(
'[' . $siteName . '] [ERREUR ' . $exception->getStatusCode() . '] ' . $exception->getMessage(
) . ''
'[' . $siteName . '] [ERREUR ' . $exception->getStatusCode() . '] ' . $exception->getMessage() . ''
) )
->text(strip_tags($message)) ->text(strip_tags($message))
->html($message); ->html($message);
$mailer->send($email); $mailer->send($email);
} }
} }

if ($exception->getStatusCode() == 404) {
return $this->render('bundles/TwigBundle/Exception/error404.html.twig', [
"code" => $exception->getStatusCode(),
"message" => $exception->getMessage()
]);
}
if (str_contains($this->getRequestStack()->getCurrentRequest(), "/admin")) { if (str_contains($this->getRequestStack()->getCurrentRequest(), "/admin")) {
return $this->render('@LcSov/exception/error.html.twig', [ return $this->render('@LcSov/exception/error.html.twig', [
"code" => $exception->getStatusCode(), "code" => $exception->getStatusCode(),

Loading…
Cancel
Save