From b8e5689363a5429ed75f8e166df1324ee5c42ecc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 23:13:30 +0100 Subject: [PATCH 1/2] [FrameworkBundle] fixed ESI calls --- src/Symfony/Bundle/FrameworkBundle/HttpKernel.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index 2551530ce2..75f32e3f95 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -113,11 +113,19 @@ class HttpKernel extends BaseHttpKernel } if ($this->esiSupport && $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($controller, 'http://') || 0 === strpos($controller, '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']); From bc09ac9eb0231496e261a5fac2bfd6935ea9f5fe Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 20 Dec 2012 23:15:41 +0100 Subject: [PATCH 2/2] fixed typo --- src/Symfony/Bundle/FrameworkBundle/HttpKernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index 75f32e3f95..1b5a22c821 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -121,7 +121,7 @@ class HttpKernel extends BaseHttpKernel $alt = ''; if ($options['alt']) { - if (is_string($options['alt']) && (0 === strpos($controller, 'http://') || 0 === strpos($controller, 'https://'))) { + 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());