From fb87b2ab0b87b236fc201f7ef417b4667977b39c Mon Sep 17 00:00:00 2001 From: Laure CHAMPEL Date: Wed, 6 Apr 2016 16:28:38 +0200 Subject: [PATCH] =?UTF-8?q?correction=20pour=20que=20les=20mails=20sur=20m?= =?UTF-8?q?iltis=20s'envoi=20bien=20car=20commande=20r=C3=A9alis=C3=A9e=20?= =?UTF-8?q?seulement=20apr=C3=A8s=20terminate=20symfony?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WordpressBundle/Services/ShortcodeRender.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sources/sf2/Generic/WordpressBundle/Services/ShortcodeRender.php b/sources/sf2/Generic/WordpressBundle/Services/ShortcodeRender.php index ca56c25..ee897e0 100644 --- a/sources/sf2/Generic/WordpressBundle/Services/ShortcodeRender.php +++ b/sources/sf2/Generic/WordpressBundle/Services/ShortcodeRender.php @@ -20,12 +20,12 @@ public function getName() return "sf2_render"; } - public function process($params=array()) + public function process($params = array()) { if (isset($params['_route'])) { $route = $this->router->getRouteCollection()->get($params['_route']); - if ($route!=null) { + if ($route != null) { $params = array_merge($route->getDefaults(), $params); } } @@ -34,10 +34,11 @@ public function process($params=array()) private function isControllerString($route) { - return (count(explode(':', $route))>=3); + return (count(explode(':', $route)) >= 3); } - protected function render($params = array()) { + protected function render($params = array()) + { if (!isset($params['_controller']) || !$this->isControllerString($params['_controller'])) { throw new \Exception('Vous n\'avez pas précisé de controller valide'); } @@ -49,6 +50,7 @@ protected function render($params = array()) { $request = Request::createFromGlobals(); $request = $request->duplicate(null, null, $params); $response = $kernel->handle($request); + $kernel->terminate($request, $response); return $response->getContent(); }