From 8509197b6db77b7d645b8ea400dd63f2234a4743 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Tue, 25 Aug 2015 21:03:50 +0100 Subject: [PATCH] Fixed RegEx to be super accurate again --- public/js/lib/coursewares/commonFrameWork.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/lib/coursewares/commonFrameWork.js b/public/js/lib/coursewares/commonFrameWork.js index 1696b87f3a..0ef7987724 100644 --- a/public/js/lib/coursewares/commonFrameWork.js +++ b/public/js/lib/coursewares/commonFrameWork.js @@ -243,7 +243,7 @@ if(typeof prodOrDev !== 'undefined') { editor.setValue(editor.getValue() + "-->"); editorValueForIFrame = editorValueForIFrame + "-->"; } - if(!editor.getValue().match(/\$\s*?\(\s*?\$\s*?\)/gi) ) { + if(!editor.getValue().match(/\$\s*?\(\s*?\$\s*?\)/gi)){ safeHTMLRun(false); } } @@ -476,7 +476,7 @@ function bonfireExecute() { ga('send', 'event', 'Challenge', 'ran-code', challenge_Name); userTests = null; $('#testSuite').empty(); - if(challengeType !== "0"){ + if(challengeType !== "0" && !editor.getValue().match(/\$\s*?\(\s*?\$\s*?\)/gi)){ var userJavaScript = myCodeMirror.getValue(); var failedCommentTest = false; if (userJavaScript.match(/\/\*/gi) && userJavaScript.match(/\*\//gi) == null) { @@ -520,7 +520,7 @@ function bonfireExecute() { editor.setValue(editor.getValue() + "-->"); editorValueForIFrame = editorValueForIFrame + "-->"; } - if(!editor.getValue().match(/\$\(\$\)/gi) && challengeType === "0") { + if(!editor.getValue().match(/\$\s*?\(\s*?\$\s*?\)/gi) && challengeType === "0") { safeHTMLRun(true); } }