Created
November 9, 2019 13:21
-
-
Save hsuan1117/c8981e695969b2ed2de294d845a1c4ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function result(text) { | |
document.getElementById("EvalResultSandBox").innerText = text; | |
} | |
function evalCode(code) { | |
if(code.from == "user_generated"){ | |
alert("Prevent XSS (Reason: user_generated code)") | |
return ; | |
}else if(code.from == "unknown"){ | |
alert("Prevent XSS (Reason: unknown code)") | |
return ; | |
}else if(code.from == "browser_variable"){ | |
alert("Prevent XSS (Reason: browser_variable code)") | |
return ; | |
}else{ | |
eval(code.code) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment