Skip to content

Commit 8d11d81

Browse files
committed
Be more tolerant and also accept <esi:include ...></esi:include>, also if it is not 100% standards compliant.
1 parent 569d562 commit 8d11d81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

HttpCache/Esi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ public function process(Request $request, Response $response)
154154

155155
// we don't use a proper XML parser here as we can have ESI tags in a plain text response
156156
$content = $response->getContent();
157-
$content = preg_replace_callback('#<esi\:include\s+(.*?)\s*/>#', array($this, 'handleEsiIncludeTag'), $content);
158-
$content = preg_replace('#<esi\:comment[^>]*/>#', '', $content);
157+
$content = preg_replace_callback('#<esi\:include\s+(.*?)\s*(?:/|</esi\:include)>#', array($this, 'handleEsiIncludeTag'), $content);
158+
$content = preg_replace('#<esi\:comment[^>]*(?:/|</esi\:comment)>#', '', $content);
159159
$content = preg_replace('#<esi\:remove>.*?</esi\:remove>#', '', $content);
160160

161161
$response->setContent($content);

0 commit comments

Comments
 (0)