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

Commit

Permalink
Compatibility handle with Symfony 2 and 3
Browse files Browse the repository at this point in the history
Compatibility handle with Symfony 2 and 3
  • Loading branch information
chadyred committed Apr 25, 2016
1 parent 9070725 commit a4515d9
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 a4515d9

Please sign in to comment.