summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-03-10 20:00:34 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-03-10 20:00:34 +0100
commitf86b5c2ebba9aaa76bbcc1dfc660f430b246d1a4 (patch)
tree416d5dbad85bc13a60d2951943fa4d1fcc026248 /lib
parentf7ebf1d47d40f42f22356e04c53d08a350aaf2cd (diff)
downloadnextcloud-server-f86b5c2ebba9aaa76bbcc1dfc660f430b246d1a4.tar.gz
nextcloud-server-f86b5c2ebba9aaa76bbcc1dfc660f430b246d1a4.zip
Properly calculate webdir using the serverroot
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Template/SCSSCacher.php15
-rw-r--r--lib/private/TemplateLayout.php3
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php
index 744ea80761e..b55cd0b93b0 100644
--- a/lib/private/Template/SCSSCacher.php
+++ b/lib/private/Template/SCSSCacher.php
@@ -46,17 +46,26 @@ class SCSSCacher {
/** @var SystemConfig */
protected $systemConfig;
+ /** @var string */
+ protected $serverRoot;
+
/**
* @param ILogger $logger
* @param IAppData $appData
* @param IURLGenerator $urlGenerator
* @param SystemConfig $systemConfig
+ * @param string $serverRoot
*/
- public function __construct(ILogger $logger, IAppData $appData, IURLGenerator $urlGenerator, SystemConfig $systemConfig) {
+ public function __construct(ILogger $logger,
+ IAppData $appData,
+ IURLGenerator $urlGenerator,
+ SystemConfig $systemConfig,
+ $serverRoot) {
$this->logger = $logger;
$this->appData = $appData;
$this->urlGenerator = $urlGenerator;
$this->systemConfig = $systemConfig;
+ $this->serverRoot = $serverRoot;
}
/**
@@ -74,9 +83,7 @@ class SCSSCacher {
$path = implode('/', $path);
- $webDir = explode('/', $file);
- array_pop($webDir);
- $webDir = implode('/', $webDir);
+ $webDir = substr($path, strlen($this->serverRoot)+1);
try {
$folder = $this->appData->getFolder($app);
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index ccd53c9cafa..680bfbbfec1 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -216,7 +216,8 @@ class TemplateLayout extends \OC_Template {
\OC::$server->getLogger(),
\OC::$server->getAppDataDir('css'),
\OC::$server->getURLGenerator(),
- \OC::$server->getSystemConfig()
+ \OC::$server->getSystemConfig(),
+ \OC::$SERVERROOT
);
} else {
$SCSSCacher = null;