Be more tolerant and also accept <esi:include ...></esi:include> #2952

Merged
merged 1 commit into from Dec 26, 2011
View
4 src/Symfony/Component/HttpKernel/HttpCache/Esi.php
@@ -154,8 +154,8 @@ public function process(Request $request, Response $response)
// we don't use a proper XML parser here as we can have ESI tags in a plain text response
$content = $response->getContent();
- $content = preg_replace_callback('#<esi\:include\s+(.*?)\s*/>#', array($this, 'handleEsiIncludeTag'), $content);
- $content = preg_replace('#<esi\:comment[^>]*/>#', '', $content);
+ $content = preg_replace_callback('#<esi\:include\s+(.*?)\s*(?:/|</esi\:include)>#', array($this, 'handleEsiIncludeTag'), $content);
+ $content = preg_replace('#<esi\:comment[^>]*(?:/|</esi\:comment)>#', '', $content);
$content = preg_replace('#<esi\:remove>.*?</esi\:remove>#', '', $content);
$response->setContent($content);