Skip to content

Commit d877154

Browse files
committed
Fix getting css when pub is not root folder
1 parent ae3baa8 commit d877154

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ViewModel/Style.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function getStyle($file)
5959
$file = $file . '.css';
6060
}
6161

62-
$asset = $this->assetRepository->createAsset($file );
62+
$asset = $this->assetRepository->createAsset($file);
6363

6464
$fileContent = null;
6565
/*
@@ -70,8 +70,13 @@ public function getStyle($file)
7070

7171
$file = '../' . $this->source->findRelativeSourceFilePath($asset);
7272

73-
if (file_exists($file) && $file != '../') {
73+
if ($file != '../' && file_exists($file)) {
7474
$fileContent = file_get_contents($file);
75+
} else {
76+
$file = $this->source->findRelativeSourceFilePath($asset);
77+
if ($file && file_exists($file)) {
78+
$fileContent = file_get_contents($file);
79+
}
7580
}
7681

7782
$fileContent = str_replace(

0 commit comments

Comments
 (0)