Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from chadyred/patch-1
Browse files Browse the repository at this point in the history
Compatibility handle with Symfony 2 and 3
  • Loading branch information
fkrauthan committed May 23, 2016
2 parents 9070725 + a4515d9 commit 77a5eef
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Assetic/Filter/CssURLRewriteFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,18 @@ private function calculateSwitchPath()

if (substr($targetPath, 0, 11) == '_controller') {
try {
$request = $this->kernel->getContainer()->get('request');
$request = null;

if ($this->container->has('request_stack')) {

$request = $this->kernel->getContainer()->get('request_stack')->getCurrentRequest();

} elseif (method_exists($this->container, 'isScopeActive') && $this->container->isScopeActive('request')) {

$request = $this->kernel->getContainer()->get('request');

}

if (substr($request->getBaseUrl(), -4) != '.php') {
$output = substr($output, 3);
}
Expand Down

0 comments on commit 77a5eef

Please sign in to comment.