aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Template
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-11-14 13:58:02 +0100
committerGitHub <noreply@github.com>2017-11-14 13:58:02 +0100
commitab0a3fbbbc24d813a13f19b89785a7f7ab8fcdb1 (patch)
tree6c21b70968a5dc21b10128ccac4515ab95c40f4e /lib/private/Template
parent2a39ac043e1bcb42111e7f442814d6f11522365b (diff)
parentd2a2793073929194cdb2de31cfb331fc5e95346e (diff)
downloadnextcloud-server-ab0a3fbbbc24d813a13f19b89785a7f7ab8fcdb1.tar.gz
nextcloud-server-ab0a3fbbbc24d813a13f19b89785a7f7ab8fcdb1.zip
Merge pull request #7061 from kyrofa/bugfix/6028/app_path_realpath
{J,CS}SResourceLocator: account for symlinks in app path
Diffstat (limited to 'lib/private/Template')
-rw-r--r--lib/private/Template/CSSResourceLocator.php5
-rw-r--r--lib/private/Template/JSResourceLocator.php7
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php
index 087ddec38ef..3c30a9d3356 100644
--- a/lib/private/Template/CSSResourceLocator.php
+++ b/lib/private/Template/CSSResourceLocator.php
@@ -76,6 +76,11 @@ class CSSResourceLocator extends ResourceLocator {
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);
}
diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php
index 9a2e0848214..d38488e4618 100644
--- a/lib/private/Template/JSResourceLocator.php
+++ b/lib/private/Template/JSResourceLocator.php
@@ -76,6 +76,13 @@ class JSResourceLocator extends ResourceLocator {
$app_path = \OC_App::getAppPath($app);
$app_url = \OC_App::getAppWebPath($app);
+ if ($app_path !== false) {
+ // Account for the possibility of having symlinks in app path. Only
+ // do this if $app_path is set, because an empty argument to realpath
+ // gets turned into cwd.
+ $app_path = realpath($app_path);
+ }
+
// missing translations files fill be ignored
if (strpos($script, 'l10n/') === 0) {
$this->appendIfExist($app_path, $script . '.js', $app_url);