diff options
author | Ruben Rodriguez <ruben@fsf.org> | 2018-05-11 13:50:22 -0400 |
---|---|---|
committer | Ruben Rodriguez <ruben@fsf.org> | 2018-05-11 13:50:22 -0400 |
commit | eb372d366b1896dba3274200d9a6992b7e2a18ff (patch) | |
tree | bf8603aaf10517d6fcbb4b46c69404d2d53b41b4 /main_background.js | |
parent | d71fe0501fc2a792b65f76145550f040201bd386 (diff) |
Prevent evaluation of external scripts, as they are always nontrivial
Diffstat (limited to 'main_background.js')
-rw-r--r-- | main_background.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/main_background.js b/main_background.js index 7a856b8..de24a4a 100644 --- a/main_background.js +++ b/main_background.js @@ -875,7 +875,10 @@ function license_read(script_src, name){ return [true,edited_src,reason_text]; } if(matches == null){ - nontrivial_status = evaluate(unedited_src,name); + if (external) + return [false,edited_src,"External script with no known license."]; + else + nontrivial_status = evaluate(unedited_src,name); if(nontrivial_status[0] == true){ parts_accepted = true; edited_src += unedited_src; @@ -903,7 +906,10 @@ function license_read(script_src, name){ // sponge console.log("before:"); console.log(before); - nontrivial_status = evaluate(before,name); + if (external) + nontrivial_status = [true, "External script with no known license"] + else + nontrivial_status = evaluate(before,name); if(nontrivial_status[0] == true){ parts_accepted = true; edited_src += before; |