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

Commit

Permalink
Added a extra check to prevent assetic:dump from working
Browse files Browse the repository at this point in the history
Fixes #23
  • Loading branch information
fkrauthan committed May 25, 2016
1 parent 3fa0135 commit 38b7687
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Assetic/Filter/CssURLRewriteFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private function getSubstringAfterNString($string, $searchString, $afterN)
{
$i=0;
$pos = -1;
while (($pos=strpos($string, $searchString, $pos+1)) !== false) {
while (($pos = strpos($string, $searchString, $pos + 1)) !== false) {
$i++;

if ($i==$afterN) {
Expand All @@ -104,10 +104,10 @@ private function getSubstringAfterNString($string, $searchString, $afterN)
private function calculateSwitchPath()
{
$targetPath = dirname($this->asset->getTargetPath());
$numDirs = substr_count($targetPath, '/')+1;
$numDirs = substr_count($targetPath, '/') + 1;

$output = '';
for ($i=0; $i<$numDirs; $i++) {
for ($i=0; $i < $numDirs; $i++) {
$output .= '../';
}

Expand All @@ -121,7 +121,7 @@ private function calculateSwitchPath()
$request = $this->kernel->getContainer()->get('request');
}

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

0 comments on commit 38b7687

Please sign in to comment.