summaryrefslogtreecommitdiffstats
path: root/lib/private/Template
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2021-12-02 00:24:40 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-01-08 10:11:58 +0100
commitf8f09bff0409347573464aba31a9775157c87530 (patch)
tree1adcc27ec5d822c7110cea3a8adf201329ac9bb7 /lib/private/Template
parentb312db382ddb58a51acbcda1158a09148c7732e2 (diff)
downloadnextcloud-server-f8f09bff0409347573464aba31a9775157c87530.tar.gz
nextcloud-server-f8f09bff0409347573464aba31a9775157c87530.zip
Restore some line in JSResourceLocator.php
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'lib/private/Template')
-rw-r--r--lib/private/Template/JSResourceLocator.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php
index 1017b8c3a06..e283ad479c6 100644
--- a/lib/private/Template/JSResourceLocator.php
+++ b/lib/private/Template/JSResourceLocator.php
@@ -56,6 +56,7 @@ class JSResourceLocator extends ResourceLocator {
// For language files we try to load them all, so themes can overwrite
// single l10n strings without having to translate all of them.
$found = 0;
+ $found += $this->appendIfExist($this->serverroot, 'core/'.$script.'.js');
$found += $this->appendIfExist($this->serverroot, $theme_dir.'core/'.$script.'.js');
$found += $this->appendIfExist($this->serverroot, $script.'.js');
$found += $this->appendIfExist($this->serverroot, $theme_dir.$script.'.js');
@@ -78,6 +79,7 @@ class JSResourceLocator extends ResourceLocator {
return;
}
+ $script = substr($script, strpos($script, '/') + 1);
$app_path = \OC_App::getAppPath($app);
$app_url = \OC_App::getAppWebPath($app);
@@ -89,21 +91,21 @@ class JSResourceLocator extends ResourceLocator {
}
// missing translations files fill be ignored
- if (strpos($scriptName, 'l10n/') === 0) {
- $this->appendIfExist($app_path, $scriptName . '.js', $app_url);
+ if (strpos($script, 'l10n/') === 0) {
+ $this->appendIfExist($app_path, $script . '.js', $app_url);
return;
}
if ($app_path === false && $app_url === false) {
$this->logger->error('Could not find resource {resource} to load', [
- 'resource' => $app . '/' . $scriptName . '.js',
+ 'resource' => $app . '/' . $script . '.js',
'app' => 'jsresourceloader',
]);
return;
}
- if (!$this->cacheAndAppendCombineJsonIfExist($app_path, $scriptName.'.json', $app)) {
- $this->append($app_path, $scriptName . '.js', $app_url);
+ if (!$this->cacheAndAppendCombineJsonIfExist($app_path, $script.'.json', $app)) {
+ $this->append($app_path, $script . '.js', $app_url);
}
}