8000 Be more tolerant and also accept <esi:include ...></esi:include>, als… · mshtukin/symfony@cae7db0 · GitHub
[go: up one dir, main page]

Skip to content

Commit cae7db0

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

File tree

1 file changed

+2
-2
lines changed
  • src/Symfony/Component/HttpKernel/HttpCache

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpKernel/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)
0