summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-03-26 14:11:58 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-03-26 14:12:44 +0200
commit12a019d328d5c773076a6efb269d49a91fd62794 (patch)
treee751165af257f322564fa11f8248385150b0503f /core/js
parentec6853a2a65c284af08f0241699f227516f25464 (diff)
downloadnextcloud-server-12a019d328d5c773076a6efb269d49a91fd62794.tar.gz
nextcloud-server-12a019d328d5c773076a6efb269d49a91fd62794.zip
Use eval instead of $.script
Fixes https://github.com/nextcloud/server/issues/4067 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js31
1 files changed, 23 insertions, 8 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 370e68f5602..f6b446ea47e 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -366,15 +366,30 @@ var OCP = {},
*/
addScript:function(app,script,ready){
var deferred, path=OC.filePath(app,'js',script+'.js');
- if(!OC.addScript.loaded[path]){
- if(ready){
- deferred=$.getScript(path,ready);
- }else{
- deferred=$.getScript(path);
+ if(!OC.addScript.loaded[path]) {
+ if(ready) {
+ deferred = jQuery.ajax({
+ url: path,
+ cache: true,
+ success: function (content) {
+ eval(content);
+ eval(ready);
+ },
+ async: false
+ });
+ } else {
+ deferred = jQuery.ajax({
+ url: path,
+ cache: true,
+ success: function (content) {
+ eval(content);
+ },
+ async: false
+ });
}
- OC.addScript.loaded[path]=deferred;
- }else{
- if(ready){
+ OC.addScript.loaded[path] = deferred;
+ } else {
+ if (ready) {
ready();
}
}