Skip to content

Commit

Permalink
CSSResourceLocator: account for symlinks in app path
Browse files Browse the repository at this point in the history
Currently, if the app path includes a symlink, the calculated webDir
will be incorrect when generating SCSS and CSS will break.

Use realpath when retrieving app path, and these issues go away.

Fix #6028

Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
  • Loading branch information
kyrofa committed Nov 4, 2017
1 parent 6fd99b4 commit 8a2a077
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/private/Template/CSSResourceLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public function doFind($style) {
return;
}

// Account for the possibility of having symlinks in app path. Doing
// this here instead of above as an empty argument to realpath gets
// turned into cwd.
$app_path = realpath($app_path);

if(!$this->cacheAndAppendScssIfExist($app_path, $style.'.scss', $app)) {
$this->append($app_path, $style.'.css', $app_url);
}
Expand Down

0 comments on commit 8a2a077

Please sign in to comment.