[HttpKernel] fixed internal fragment handling

This commit is contained in:
Fabien Potencier 2014-09-03 10:09:50 +02:00
parent b60b5d4b24
commit 23eb033abb
1 changed files with 6 additions and 3 deletions

View File

@ -16,6 +16,7 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\UriSigner;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
@ -24,8 +25,8 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
* All URL paths starting with /_fragment are handled as
* content fragments by this listener.
*
* If the request does not come from a trusted IP, it throws an
* AccessDeniedHttpException exception.
* If throws an AccessDeniedHttpException exception if the request
* is not signed or if it is not an internal sub-request.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
@ -61,7 +62,9 @@ class FragmentListener implements EventSubscriberInterface
return;
}
$this->validateRequest($request);
if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) {
$this->validateRequest($request);
}
parse_str($request->query->get('_path', ''), $attributes);
$request->attributes->add($attributes);