Skip to content

Commit

Permalink
Merge pull request freeCodeCamp#3697 from FreeCodeCamp/fix/form-actio…
Browse files Browse the repository at this point in the history
…n-regex

Fix form action attribute regex
  • Loading branch information
QuincyLarson committed Oct 12, 2015
2 parents f6541f3 + 51012bd commit f8105dd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions client/commonFramework.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ var common = (function() {
};

common.replaceFormActionAttr = function replaceFormAction(value) {
return value.replace(/<form.*?>/, function(val) {
return val.replace('action=', 'fccfaa=');
return value.replace(/<form[^>]*>/, function(val) {
return val.replace(/action(\s*?)=/, 'fccfaa$1=');
});
};

common.replaceFccfaaAttr = function replaceFccfaaAttr(value) {
return value.replace(/<form.*?>/, function(val) {
return val.replace('fccfaa=', 'action=');
return value.replace(/<form[^>]*>/, function(val) {
return val.replace(/fccfaa(\s*?)=/, 'action$1=');
});
};

Expand Down Expand Up @@ -453,7 +453,6 @@ var editor = (function(CodeMirror, emmetCodeMirror, common) {
common.init.push(function() {
var editorValue;
if (common.codeUri.isAlive()) {
console.log('in query');
editorValue = common.codeUri.parse();
} else {
editorValue = codeStorage.isAlive() ?
Expand Down

0 comments on commit f8105dd

Please sign in to comment.