aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Rodriguez <ruben@fsf.org>2018-05-11 13:50:22 -0400
committerRuben Rodriguez <ruben@fsf.org>2018-05-11 13:50:22 -0400
commiteb372d366b1896dba3274200d9a6992b7e2a18ff (patch)
treebf8603aaf10517d6fcbb4b46c69404d2d53b41b4
parentd71fe0501fc2a792b65f76145550f040201bd386 (diff)
Prevent evaluation of external scripts, as they are always nontrivial
-rw-r--r--main_background.js10
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;