From 2f5b7a7db20fb2a7db1086c9fb68d65f1e2b934c Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Mon, 3 Aug 2015 17:12:48 +0100 Subject: [PATCH] Fix https://github.com/FreeCodeCamp/freecodecamp/issues/1433 blocked tests passing when exploit used --- .../lib/coursewares/coursewaresJSFramework_0.0.6.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js b/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js index f88bca61aa..0710e4ee6e 100644 --- a/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js +++ b/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js @@ -210,7 +210,16 @@ var runTests = function(err, data) { err: "No user tests were run." }]; 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); pushed = true; userTests.forEach(function(chaiTestFromJSON, indexOfTestArray,