Skip to content

Commit

Permalink
Compare with realpath
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Dec 1, 2021
1 parent 8bd5200 commit f0d40ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ThemeBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static function createFromTheme(Theme $theme): self
// Resolve the directory for the active theme
$root = rtrim(config('Assets')->directory, '/ ') . '/';
$directory = $root . trim($theme->path, '/ ');
$directory = realpath($directory) ?: $directory;

// Locate all CSS and JSS files in the them path
$files = (new FileCollection())
Expand All @@ -41,7 +42,9 @@ public static function createFromTheme(Theme $theme): self

// Create an Asset from each relative path and add it to the Bundle
foreach ($files as $file) {
$file = realpath($file) ?: $file;
$relativePath = str_replace($root, '', $file);

$bundle->add(Asset::createFromPath($relativePath));
}

Expand Down

0 comments on commit f0d40ec

Please sign in to comment.