Fix https://github.com/FreeCodeCamp/freecodecamp/issues/1433 blocked tests passing when exploit used
parent
c9c2a74461
commit
2f5b7a7db2
|
@ -210,7 +210,16 @@ var runTests = function(err, data) {
|
||||||
err: "No user tests were run."
|
err: "No user tests were run."
|
||||||
}];
|
}];
|
||||||
createTestDisplay();
|
createTestDisplay();
|
||||||
} else if (userTests) {
|
}
|
||||||
|
else if(editorValue.match(/if\s\(null\)\sconsole\.log\(1\);/gi)){
|
||||||
|
allTestsPassed = false;
|
||||||
|
userTests = [{
|
||||||
|
text: "Program Execution Failure",
|
||||||
|
err: "Invalid if (null) console.log(1); detected"
|
||||||
|
}];
|
||||||
|
createTestDisplay();
|
||||||
|
}
|
||||||
|
else if (userTests) {
|
||||||
userTests.push(false);
|
userTests.push(false);
|
||||||
pushed = true;
|
pushed = true;
|
||||||
userTests.forEach(function(chaiTestFromJSON, indexOfTestArray,
|
userTests.forEach(function(chaiTestFromJSON, indexOfTestArray,
|
||||||
|
|
Loading…
Reference in New Issue