diff --git a/client/commonFramework/code-storage.js b/client/commonFramework/code-storage.js index e7ff937528..4eca143dad 100644 --- a/client/commonFramework/code-storage.js +++ b/client/commonFramework/code-storage.js @@ -5,6 +5,10 @@ window.common = (function(global) { common = { init: [] } } = global; + const { + replaceNoprotect + } = common; + var challengePrefix = [ 'Bonfire: ', 'Waypoint: ', @@ -54,7 +58,7 @@ window.common = (function(global) { console.log('unable to save to storage'); return code; } - localStorage.setItem(key + 'Val', code); + localStorage.setItem(key + 'Val', replaceNoprotect(code)); return code; } }; diff --git a/client/commonFramework/code-uri.js b/client/commonFramework/code-uri.js index fefe45e0fe..c2642aa264 100644 --- a/client/commonFramework/code-uri.js +++ b/client/commonFramework/code-uri.js @@ -12,12 +12,13 @@ window.common = (function(global) { replaceScriptTags, replaceSafeTags, replaceFormActionAttr, - replaceFccfaaAttr + replaceFccfaaAttr, + replaceNoprotect } = common; const queryRegex = /^(\?|#\?)/; function encodeFcc(val) { - return replaceScriptTags(replaceFormActionAttr(val)); + return replaceScriptTags(replaceFormActionAttr(replaceNoprotect(val))); } function decodeFcc(val) { diff --git a/client/commonFramework/init.js b/client/commonFramework/init.js index e054bab6c1..7344e6f0be 100644 --- a/client/commonFramework/init.js +++ b/client/commonFramework/init.js @@ -33,6 +33,10 @@ window.common = (function(global) { common.seed = common.arrayToNewLineString(common.challengeSeed); + common.replaceNoprotect = function replaceNoprotect(value) { + return value.replace(/noprotect/gi, ''); + }; + common.replaceScriptTags = function replaceScriptTags(value) { return value .replace(/