Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2017-12-27 13:01:27 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-01-04 00:04:59 +0300
commit00412d1c8ce7c699a83740d20209bd3e0bdda906 (patch)
tree243681d3b5ceafd342b9798264fd35aa6a3507dc /lib
parentf13b3b6651b81d1bd4a314ce1e66e164e9ac5f1d (diff)
Fixed webroot for scss files
Fixed tests Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Template/CSSResourceLocator.php4
-rw-r--r--lib/private/Template/SCSSCacher.php18
2 files changed, 17 insertions, 5 deletions
diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php
index d5e9ce732cc..2226f4f6a39 100644
--- a/lib/private/Template/CSSResourceLocator.php
+++ b/lib/private/Template/CSSResourceLocator.php
@@ -104,7 +104,7 @@ class CSSResourceLocator extends ResourceLocator {
if($this->scssCacher !== null) {
if($this->scssCacher->process($root, $file, $app)) {
- $this->append($root, $this->scssCacher->getCachedSCSS($app, $file), false, true, true);
+ $this->append($root, $this->scssCacher->getCachedSCSS($app, $file), \OC::$WEBROOT, true, true);
return true;
} else {
$this->logger->warning('Failed to compile and/or save '.$root.'/'.$file, ['app' => 'core']);
@@ -141,7 +141,7 @@ class CSSResourceLocator extends ResourceLocator {
}
}
- $this->resources[] = array($webRoot? : '/', $webRoot, $file);
+ $this->resources[] = array($webRoot? : \OC::$WEBROOT, $webRoot, $file);
}
}
}
diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php
index cfe0e60523d..9b41aae11d7 100644
--- a/lib/private/Template/SCSSCacher.php
+++ b/lib/private/Template/SCSSCacher.php
@@ -102,8 +102,21 @@ class SCSSCacher {
$fileNameCSS = $this->prependBaseurlPrefix(str_replace('.scss', '.css', $fileNameSCSS));
$path = implode('/', $path);
-
- $webDir = substr($path, strlen($this->serverRoot)+1);
+ $webDir = null;
+
+ // Detect if path is within an app path
+ $app_paths = $this->config->getSystemValue('apps_paths');
+ if (!empty($app_paths)) {
+ foreach ($app_paths as $app_path) {
+ if (strpos($path, $app_path["path"]) === 0) {
+ $webDir = $app_path["url"].str_replace($app_path["path"], '', $path);
+ break;
+ }
+ }
+ }
+ if (is_null($webDir)) {
+ $webDir = substr($path, strlen($this->serverRoot));
+ }
try {
$folder = $this->appData->getFolder($app);
@@ -294,7 +307,6 @@ class SCSSCacher {
* @return string
*/
public function getCachedSCSS($appName, $fileName) {
- //var_dump([$appName, $fileName]);
$tmpfileLoc = explode('/', $fileName);
$fileName = array_pop($tmpfileLoc);
$fileName = $this->prependBaseurlPrefix(str_replace('.scss', '.css', $fileName));