diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml index 0ebb44bbd2708..8cdd039d86980 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml @@ -44,7 +44,7 @@ - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PathPackage.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PathPackage.php index 6aa8c58824669..ca9bb573d2173 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PathPackage.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PathPackage.php @@ -11,8 +11,9 @@ namespace Symfony\Bundle\FrameworkBundle\Templating\Asset; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Templating\Asset\PathPackage as BasePathPackage; +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Request; /** * The path packages adds a version and a base path to asset URLs. @@ -24,12 +25,18 @@ class PathPackage extends BasePathPackage /** * Constructor. * - * @param Request $request The current request - * @param string $version The version - * @param string $format The version format + * @param Request $requestStack The current request + * @param string $version The version + * @param string $format The version format */ - public function __construct(Request $request, $version = null, $format = null) + public function __construct(RequestStack $requestStack, $version = null, $format = null) { - parent::__construct($request->getBasePath(), $version, $format); + if ($requestStack->getCurrentRequest() instanceof Request) { + $path = $requestStack->getCurrentRequest()->getBasePath(); + } else { + $path = "/"; + } + + parent::__construct($path, $version, $format); } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy