From ce536cdd5a47311fda4b6f373d04ff6c7147647e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 23:02:55 +0100 Subject: [PATCH] [FrameworkBundle] fixed ESI calls --- .../Bundle/FrameworkBundle/HttpKernel.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index 722bc6f960..9f499d4743 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -116,18 +116,30 @@ class HttpKernel extends BaseHttpKernel } if ($this->esiSupport && (true === $options['standalone'] || 'esi' === $options['standalone'])) { - $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query']); + if (0 === strpos($controller, 'http://') || 0 === strpos($controller, 'https://')) { + $uri = $controller; + } else { + $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query']); + } $alt = ''; if ($options['alt']) { - $alt = $this->generateInternalUri($options['alt'][0], isset($options['alt'][1]) ? $options['alt'][1] : array(), isset($options['alt'][2]) ? $options['alt'][2] : array()); + if (is_string($options['alt']) && (0 === strpos($options['alt'], 'http://') || 0 === strpos($options['alt'], 'https://'))) { + $alt = $options['alt']; + } else { + $alt = $this->generateInternalUri($options['alt'][0], isset($options['alt'][1]) ? $options['alt'][1] : array(), isset($options['alt'][2]) ? $options['alt'][2] : array()); + } } return $this->container->get('esi')->renderIncludeTag($uri, $alt, $options['ignore_errors'], $options['comment']); } if ('js' === $options['standalone']) { - $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query'], false); + if (0 === strpos($controller, 'http://') || 0 === strpos($controller, 'https://')) { + $uri = $controller; + } else { + $uri = $this->generateInternalUri($controller, $options['attributes'], $options['query'], false); + } $defaultContent = null; if ($template = $this->container->getParameter('templating.hinclude.default_template')) {