X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/restate/vendor/symfony/http-kernel/EventListener
home
/
gfecatvj
/
sites
/
restate
/
vendor
/
symfony
/
http-kernel
/
EventListener
/
📁
..
📄
AbstractSessionListener.php
(7.68 KB)
📄
AbstractTestSessionListener.php
(3.54 KB)
📄
AddRequestFormatsListener.php
(1.2 KB)
📄
DebugHandlersListener.php
(6.9 KB)
📄
DisallowRobotsIndexingListener.php
(1.1 KB)
📄
DumpListener.php
(1.72 KB)
📄
ErrorListener.php
(5.24 KB)
📄
FragmentListener.php
(2.84 KB)
📄
LocaleAwareListener.php
(2.35 KB)
📄
LocaleListener.php
(2.54 KB)
📄
ProfilerListener.php
(3.97 KB)
📄
ResponseListener.php
(1.3 KB)
📄
RouterListener.php
(6.72 KB)
📄
SessionListener.php
(1.53 KB)
📄
StreamedResponseListener.php
(1.21 KB)
📄
SurrogateListener.php
(1.75 KB)
📄
TestSessionListener.php
(985 B)
📄
ValidateRequestListener.php
(1.18 KB)
Editing: FragmentListener.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\UriSigner; /** * Handles content fragments represented by special URIs. * * All URL paths starting with /_fragment are handled as * content fragments by this listener. * * 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> * * @final */ class FragmentListener implements EventSubscriberInterface { private $signer; private $fragmentPath; /** * @param string $fragmentPath The path that triggers this listener */ public function __construct(UriSigner $signer, string $fragmentPath = '/_fragment') { $this->signer = $signer; $this->fragmentPath = $fragmentPath; } /** * Fixes request attributes when the path is '/_fragment'. * * @throws AccessDeniedHttpException if the request does not come from a trusted IP */ public function onKernelRequest(RequestEvent $event) { $request = $event->getRequest(); if ($this->fragmentPath !== rawurldecode($request->getPathInfo())) { return; } if ($request->attributes->has('_controller')) { // Is a sub-request: no need to parse _path but it should still be removed from query parameters as below. $request->query->remove('_path'); return; } if ($event->isMasterRequest()) { $this->validateRequest($request); } parse_str($request->query->get('_path', ''), $attributes); $request->attributes->add($attributes); $request->attributes->set('_route_params', array_replace($request->attributes->get('_route_params', []), $attributes)); $request->query->remove('_path'); } protected function validateRequest(Request $request) { // is the Request safe? if (!$request->isMethodSafe()) { throw new AccessDeniedHttpException(); } // is the Request signed? if ($this->signer->checkRequest($request)) { return; } throw new AccessDeniedHttpException(); } public static function getSubscribedEvents(): array { return [ KernelEvents::REQUEST => [['onKernelRequest', 48]], ]; } }
Upload File
Create Folder