Properly calculate webdir using the serverroot

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-03-10 20:00:34 +01:00
parent f7ebf1d47d
commit f86b5c2ebb
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 13 additions and 5 deletions

View File

@ -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);

View File

@ -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;