https://api.dev.nitropolska.pl/index.php/

Exceptions

Cannot redirect to an empty URL.

Exception

InvalidArgumentException

  1.      * @throws \InvalidArgumentException
  2.      */
  3.     public function setTargetUrl($url)
  4.     {
  5.         if ('' === ($url ?? '')) {
  6.             throw new \InvalidArgumentException('Cannot redirect to an empty URL.');
  7.         }
  8.         $this->targetUrl $url;
  9.         $this->setContent(
  1.             $url '';
  2.         }
  3.         parent::__construct(''$status$headers);
  4.         $this->setTargetUrl($url);
  5.         if (!$this->isRedirect()) {
  6.             throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).'$status));
  7.         }
  1.         $queryString $request->getQueryString();
  2.         $repository  $this->getEntityManager()->getRepository(Redirect::class);
  3.         if (false !== strpos($request->getRequestUri(), '/index.php')) {
  4.             $target   str_replace('/index.php'''$request->getRequestUri());
  5.             $response = new RedirectResponse($targetResponse::HTTP_MOVED_PERMANENTLY);
  6.             $event->setResponse($response);
  7.             return;
  8.         }
  9.         if (!empty($queryString) && strlen($queryString) > && false === strpos($queryString'utm')) {
  1.         $this->called true;
  2.         $this->priority $dispatcher->getListenerPriority($eventName$this->listener);
  3.         $e $this->stopwatch->start($this->name'event_listener');
  4.         ($this->optimizedListener ?? $this->listener)($event$eventName$dispatcher);
  5.         if ($e->isStarted()) {
  6.             $e->stop();
  7.         }
  1.     {
  2.         foreach ($listeners as $listener) {
  3.             if ($event->isPropagationStopped()) {
  4.                 break;
  5.             }
  6.             $listener($event$eventName$this);
  7.         }
  8.     }
  9.     /**
  10.      * Sorts the internal list of listeners for the given event by priority.
  1.      * @param object     $event     The event object to pass to the event handlers/listeners
  2.      */
  3.     protected function callListeners(iterable $listenersstring $eventName$event)
  4.     {
  5.         if ($event instanceof Event) {
  6.             $this->doDispatch($listeners$eventName$event);
  7.             return;
  8.         }
  9.         $stoppable $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;
  1.         } else {
  2.             $listeners $this->getListeners($eventName);
  3.         }
  4.         if ($listeners) {
  5.             $this->callListeners($listeners$eventName$event);
  6.         }
  7.         return $event;
  8.     }
  1.         try {
  2.             $this->beforeDispatch($eventName$event);
  3.             try {
  4.                 $e $this->stopwatch->start($eventName'section');
  5.                 try {
  6.                     $this->dispatcher->dispatch($event$eventName);
  7.                 } finally {
  8.                     if ($e->isStarted()) {
  9.                         $e->stop();
  10.                     }
  11.                 }
  1.      */
  2.     private function handleRaw(Request $requestint $type self::MASTER_REQUEST): Response
  3.     {
  4.         // request
  5.         $event = new RequestEvent($this$request$type);
  6.         $this->dispatcher->dispatch($eventKernelEvents::REQUEST);
  7.         if ($event->hasResponse()) {
  8.             return $this->filterResponse($event->getResponse(), $request$type);
  9.         }
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle() in public/index.php (line 56)
  1. putenv('COOKIE_DOMAIN=' $cookieDomain);
  2. $kernel   = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']);
  3. $request  Request::createFromGlobals();
  4. $response $kernel->handle($request);
  5. $response->send();
  6. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

InvalidArgumentException

InvalidArgumentException:
Cannot redirect to an empty URL.

  at vendor/symfony/http-foundation/RedirectResponse.php:91
  at Symfony\Component\HttpFoundation\RedirectResponse->setTargetUrl()
     (vendor/symfony/http-foundation/RedirectResponse.php:44)
  at Symfony\Component\HttpFoundation\RedirectResponse->__construct()
     (src/WellCommerce/Bundle/AppBundle/EventListener/RedirectSubscriber.php:57)
  at WellCommerce\Bundle\AppBundle\EventListener\RedirectSubscriber->onKernelRequest()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:126)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:264)
  at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:239)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:73)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:168)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:145)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:81)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:56)