feat(user): Report profiles
This adds a simple email-based mechanism to report profiles for abuse. An email with text from the report is sent to Free Code Camp's support account with the reporter's account in copy. This also adds the reporter's details to the report for follow ups.
This commit is contained in:
@@ -26,6 +26,30 @@ export default function() {
|
||||
// every file has contents
|
||||
keys.map(key => value[key]).every(file => isPoly(file));
|
||||
}
|
||||
},
|
||||
customSanitizers: {
|
||||
// Refer : http://stackoverflow.com/a/430240/1932901
|
||||
trimTags(value) {
|
||||
const tagBody = '(?:[^"\'>]|"[^"]*"|\'[^\']*\')*';
|
||||
const tagOrComment = new RegExp(
|
||||
'<(?:'
|
||||
// Comment body.
|
||||
+ '!--(?:(?:-*[^->])*--+|-?)'
|
||||
// Special "raw text" elements whose content should be elided.
|
||||
+ '|script\\b' + tagBody + '>[\\s\\S]*?</script\\s*'
|
||||
+ '|style\\b' + tagBody + '>[\\s\\S]*?</style\\s*'
|
||||
// Regular name
|
||||
+ '|/?[a-z]'
|
||||
+ tagBody
|
||||
+ ')>',
|
||||
'gi');
|
||||
let rawValue;
|
||||
do {
|
||||
rawValue = value;
|
||||
value = value.replace(tagOrComment, '');
|
||||
} while (value !== rawValue);
|
||||
return value.replace(/</g, '<');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user