Skip to content

Commit

Permalink
Laura/Medina: Escape & character in the restricted fields
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraionescu committed Sep 29, 2016
1 parent d2d8e83 commit 62d90d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spec/util/inputSanitizer-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('InputSanitizer', function(){
Name: "Hello <script>alert('dangerous');</script>there <h1>blip</h1>",
description: description,
cycle: '<a href="/asd">Adopt</a>',
quadrant: '<strong>techniques</strong>',
quadrant: '<strong>techniques & tools</strong>',
isNew: 'true<br>'
};

Expand All @@ -34,6 +34,6 @@ describe('InputSanitizer', function(){
});

it('strips out all tags from blip quadrant', function(){
expect(blip.quadrant).toEqual("techniques");
expect(blip.quadrant).toEqual("techniques & tools");
});
});
5 changes: 4 additions & 1 deletion src/util/inputSanitizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const InputSanitizer = function () {

var restrictedOptions = {
allowedTags: [],
allowedAttributes: {}
allowedAttributes: {},
textFilter: function(text) {
return text.replace(/&amp;/, '&');
}
};

var self = {};
Expand Down

0 comments on commit 62d90d7

Please sign in to comment.