Symfony Exception

RuntimeException

HTTP 500 Internal Server Error

Template name "../../mobile_new/index.php" contains invalid characters.

Exception

RuntimeException

  1.         // normalize name
  2.         $name preg_replace('#/{2,}#''/'str_replace('\\''/'$name));
  3.         if (false !== strpos($name'..')) {
  4.             throw new \RuntimeException(sprintf('Template name "%s" contains invalid characters.'$name));
  5.         }
  6.         if (!preg_match('/^(?:([^:]*):([^:]*):)?(.+)\.([^\.]+)\.([^\.]+)$/'$name$matches) || === strpos($name'@')) {
  7.             return parent::parse($name);
  8.         }
  1.      *
  2.      * @throws \InvalidArgumentException if the template cannot be found
  3.      */
  4.     protected function load($name)
  5.     {
  6.         $template $this->parser->parse($name);
  7.         $key $template->getLogicalName();
  8.         if (isset($this->cache[$key])) {
  9.             return $this->cache[$key];
  10.         }
  1.      *
  2.      * @throws \InvalidArgumentException if the template does not exist
  3.      */
  4.     public function render($name, array $parameters = [])
  5.     {
  6.         $storage $this->load($name);
  7.         $key hash('sha256'serialize($storage));
  8.         $this->current $key;
  9.         $this->parents[$key] = null;
  10.         // attach the global variables
  1.      */
  2.     public function render($name, array $parameters = [])
  3.     {
  4.         $e $this->stopwatch->start(sprintf('template.php (%s)'$name), 'template');
  5.         $ret parent::render($name$parameters);
  6.         $e->stop();
  7.         return $ret;
  8.     }
  1.     protected function render(string $view, array $parameters = [], Response $response null): Response
  2.     {
  3.         if ($this->container->has('templating')) {
  4.             @trigger_error('Using the "templating" service is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.'E_USER_DEPRECATED);
  5.             $content $this->container->get('templating')->render($view$parameters);
  6.         } elseif ($this->container->has('twig')) {
  7.             $content $this->container->get('twig')->render($view$parameters);
  8.         } else {
  9.             throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".');
  10.         }
Controller->render() in src/Controller/MobileController.php (line 97)
  1.                 $utilisateur['photo'] = 'avatar.jpg';
  2.             else
  3.                 $utilisateur['photo'] = $user->getPhoto();
  4.         }
  5.             
  6.      return $this->render('../../mobile_new/index.php', array());
  7.     //return "mobile_new/index.php";
  8.    
  9.     }
  10. // Ajout Emmanuel 26/10/2022  fonction accès mobile 
  11. /**
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  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 41)
  1. $kernel = new Kernel($env$debug);
  2. $request Request::createFromGlobals();
  3. $response $kernel->handle($request);
  4. $response->send();
  5. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

RuntimeException

RuntimeException:
Template name "../../mobile_new/index.php" contains invalid characters.

  at vendor/symfony/framework-bundle/Templating/TemplateNameParser.php:54
  at Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser->parse()
     (vendor/symfony/templating/PhpEngine.php:497)
  at Symfony\Component\Templating\PhpEngine->load()
     (vendor/symfony/templating/PhpEngine.php:68)
  at Symfony\Component\Templating\PhpEngine->render()
     (vendor/symfony/framework-bundle/Templating/TimedPhpEngine.php:46)
  at Symfony\Bundle\FrameworkBundle\Templating\TimedPhpEngine->render()
     (vendor/symfony/framework-bundle/Controller/ControllerTrait.php:233)
  at Symfony\Bundle\FrameworkBundle\Controller\Controller->render()
     (src/Controller/MobileController.php:97)
  at App\Controller\MobileController->index()
     (vendor/symfony/http-kernel/HttpKernel.php:158)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:80)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:41)