Skip to content

Commit

Permalink
[HttpKernel] added a safeguard for when a fragment is rendered outsid…
Browse files Browse the repository at this point in the history
…e the context of a master request
  • Loading branch information
fabpot committed Mar 20, 2013
1 parent 5d7b835 commit bb83b3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php
Expand Up @@ -93,6 +93,10 @@ public function render($uri, $renderer = 'inline', array $options = array())
throw new \InvalidArgumentException(sprintf('The "%s" renderer does not exist.', $renderer));
}

if (null === $this->request) {
throw new \LogicException('Rendering a fragment can only be done when handling a master Request.');
}

return $this->deliver($this->renderers[$renderer]->render($uri, $this->request, $options));
}

Expand Down

0 comments on commit bb83b3e

Please sign in to comment.