summaryrefslogtreecommitdiffstats
path: root/lib/private/template/jsresourcelocator.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-03-04 13:24:24 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2015-03-04 17:56:33 +0100
commit716ba49a82ab7c0a68f3b4f442ea8ed84c06f317 (patch)
tree26357cce2f08a3682435d2af931e44b2da371d5f /lib/private/template/jsresourcelocator.php
parentf507601e259da2e6b67237ffcfe8eeda880062ef (diff)
downloadnextcloud-server-716ba49a82ab7c0a68f3b4f442ea8ed84c06f317.tar.gz
nextcloud-server-716ba49a82ab7c0a68f3b4f442ea8ed84c06f317.zip
Log errors and create 404 in network list when a css or js is missing
Diffstat (limited to 'lib/private/template/jsresourcelocator.php')
-rw-r--r--lib/private/template/jsresourcelocator.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/private/template/jsresourcelocator.php b/lib/private/template/jsresourcelocator.php
index 5a6672429cf..6ddc5e6ad7d 100644
--- a/lib/private/template/jsresourcelocator.php
+++ b/lib/private/template/jsresourcelocator.php
@@ -9,7 +9,10 @@
namespace OC\Template;
class JSResourceLocator extends ResourceLocator {
- public function doFind( $script ) {
+ /**
+ * @param string $script
+ */
+ public function doFind($script) {
$theme_dir = 'themes/'.$this->theme.'/';
if (strpos($script, '3rdparty') === 0
&& $this->appendIfExist($this->thirdpartyroot, $script.'.js')
@@ -25,16 +28,18 @@ class JSResourceLocator extends ResourceLocator {
$script = substr($script, strpos($script, '/')+1);
$app_path = \OC_App::getAppPath($app);
$app_url = \OC_App::getAppWebPath($app);
- if ($this->appendIfExist($app_path, $script.'.js', $app_url)) {
- return;
- }
+
// missing translations files fill be ignored
- if (strpos($script, "l10n/") === 0) {
+ if (strpos($script, 'l10n/') === 0) {
+ $this->appendIfExist($app_path, $script . '.js', $app_url);
return;
}
- throw new \Exception('js file not found: script:'.$script);
+ $this->append($app_path, $script . '.js', $app_url);
}
- public function doFindTheme( $script ) {
+ /**
+ * @param string $script
+ */
+ public function doFindTheme($script) {
}
}