Skip to content

Commit bb83b3e

Browse files
committed
[HttpKernel] added a safeguard for when a fragment is rendered outside the context of a master request
1 parent 5d7b835 commit bb83b3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public function render($uri, $renderer = 'inline', array $options = array())
9393
throw new \InvalidArgumentException(sprintf('The "%s" renderer does not exist.', $renderer));
9494
}
9595

96+
if (null === $this->request) {
97+
throw new \LogicException('Rendering a fragment can only be done when handling a master Request.');
98+
}
99+
96100
return $this->deliver($this->renderers[$renderer]->render($uri, $this->request, $options));
97101
}
98102

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy