Skip to content

Instantly share code, notes, and snippets.

@alexlehm
Created December 24, 2013 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexlehm/8107770 to your computer and use it in GitHub Desktop.
Save alexlehm/8107770 to your computer and use it in GitHub Desktop.
//This module is adapted from the CodeIgniter framework
//The license is available at http://codeigniter.com/
var html_entity_decode = require('./entities').decode;
var never_allowed_str = {
'document.cookie': '[removed]',
'document.write': '[removed]',
'.parentNode': '[removed]',
'.innerHTML': '[removed]',
'window.location': '[removed]',
'-moz-binding': '[removed]',
'<!--': '&lt;!--',
'-->': '--&gt;',
'(<!\\[CDATA\\[)': '&lt;![CDATA[',
'<comment>': '&lt;comment&gt;'
};
var never_allowed_regex = {
// 'javascript\\s*:': '[removed]',
'expression\\s*(\\(|&#40;)': '[removed]',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment