Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use the correct root to determinate the webroot for the resource
Since all the compiled routes are based on the server webroot,
we have to use this, independent from which app this belongs to.

Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Sep 2, 2020
commit 87aa9b187e07c8042ae10ab55254068df60a04b0
4 changes: 2 additions & 2 deletions lib/private/Template/CSSResourceLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected function cacheAndAppendScssIfExist($root, $file, $app = 'core') {
if (is_file($root.'/'.$file)) {
if ($this->scssCacher !== null) {
if ($this->scssCacher->process($root, $file, $app)) {
$this->append($root, $this->scssCacher->getCachedSCSS($app, $file), \OC::$WEBROOT, true, true);
$this->append($this->serverroot, $this->scssCacher->getCachedSCSS($app, $file), \OC::$WEBROOT, true, true);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this tried to load /home/nickv/Nextcloud/20/appsbabies/spreed index.php/css/spreed/2359-7462-unified-search.css?v=d0784d96eefd0edc6bea0c967d17b4ea which is wrong, because the index.php is located in the serverroot, not the apps webroot. It worked for most of us because it fell back to '' logged an error and loaded the file anyway. It only broke visually when nextcloud had a non-empty webroot, e.g. (https://example.tld/nextcloud)

return true;
} else {
$this->logger->warning('Failed to compile and/or save '.$root.'/'.$file, ['app' => 'core']);
Expand Down Expand Up @@ -145,7 +145,7 @@ public function append($root, $file, $webRoot = null, $throw = true, $scss = fal
}
}

$this->resources[] = [$webRoot? : \OC::$WEBROOT, $webRoot, $file];
$this->resources[] = [$webRoot ?: \OC::$WEBROOT, $webRoot, $file];
}
}
}