Skip to content

Conversation

mesabuca
Copy link

@mesabuca mesabuca commented Jan 1, 2019

I added a function that encoding the html tags to avoid html injection.

I added a function that encoding the html tags to avoid html injection.
config.get("list").onMouseOutEvent();
})
.html(template.build(highlight(elementsValue, phrase), listData[j]));
.html(template.build(highlight(htmlEntities(elementsValue), phrase), listData[j]));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add a config flag for this HTML injection feature, so a user can decide whether they want to use it or not. It can be enabled by default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you are right. I forget the flags. I will check it tonight.

$field.after($elements_container);
}

function htmlEntities(str) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename this method to striHTMLTags?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants