diff options
author | Kyle Fazzari <kyrofa@ubuntu.com> | 2017-11-07 14:54:21 -0800 |
---|---|---|
committer | Kyle Fazzari <kyrofa@ubuntu.com> | 2017-11-07 14:54:21 -0800 |
commit | 06ba1a8a02f08e066ad97cdd192534c296f3a640 (patch) | |
tree | 4086187ac229989089e35cb87262a8d7884cd6c5 /lib | |
parent | b0d296639cfc5d0460987787cc9869c5e5473d85 (diff) | |
download | nextcloud-server-06ba1a8a02f08e066ad97cdd192534c296f3a640.tar.gz nextcloud-server-06ba1a8a02f08e066ad97cdd192534c296f3a640.zip |
JSResourceLocator: account for symlinks in app path
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Template/JSResourceLocator.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php index 97a9eacedf5..228fa09e821 100644 --- a/lib/private/Template/JSResourceLocator.php +++ b/lib/private/Template/JSResourceLocator.php @@ -75,9 +75,14 @@ class JSResourceLocator extends ResourceLocator { $app_path = \OC_App::getAppPath($app); $app_url = \OC_App::getAppWebPath($app); + // Account for the possibility of having symlinks in app path. Doing + // this in a separate variable, because an empty argument to realpath + // gets turned into cwd, which makes it hard to see if app_path got set. + $real_app_path = realpath($app_path); + // missing translations files fill be ignored if (strpos($script, 'l10n/') === 0) { - $this->appendIfExist($app_path, $script . '.js', $app_url); + $this->appendIfExist($real_app_path, $script . '.js', $app_url); return; } @@ -89,8 +94,8 @@ class JSResourceLocator extends ResourceLocator { return; } - if (!$this->cacheAndAppendCombineJsonIfExist($app_path, $script.'.json', $app)) { - $this->append($app_path, $script . '.js', $app_url); + if (!$this->cacheAndAppendCombineJsonIfExist($real_app_path, $script.'.json', $app)) { + $this->append($real_app_path, $script . '.js', $app_url); } } |