diff --git a/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php b/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php index 3c639f2034c75..88ed375dd15e8 100644 --- a/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php +++ b/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php @@ -36,7 +36,18 @@ public function __construct($documentRoot, $env, $address = null, $router = null $this->documentRoot = $documentRoot; $this->env = $env; - $this->router = $router ?: __DIR__.'/Resources/router.php'; + + if (null !== $router) { + $absoluteRouterPath = realpath($router); + + if (false === $absoluteRouterPath) { + throw new \InvalidArgumentException(sprintf('Router script "%s" does not exist.', $router)); + } + + $this->router = $absoluteRouterPath; + } else { + $this->router = __DIR__.'/Resources/router.php'; + } if (null === $address) { $this->hostname = '127.0.0.1';
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: