Skip to content

Commit 0aeea79

Browse files
fixed eslint issue
1 parent 4319aa8 commit 0aeea79

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

server/hooks/xss.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const sanitizeHtml = require('sanitize-html');
22
const _ = require('lodash');
33

4-
function clean (dirty, hook) {
4+
function clean (dirty) {
55
dirty = sanitizeHtml(dirty, {
66
allowedTags: ['iframe', 'img', 'p', 'br', 'b', 'i', 'em', 'strong', 'a', 'pre', 'ul', 'li', 'ol'],
77
allowedAttributes: {
@@ -64,7 +64,7 @@ module.exports = function (options = { fields: [] }) {
6464
}
6565
});
6666
} else if (!_.isEmpty(hook.data) && !_.isEmpty(hook.data[field])) {
67-
hook.data[field] = clean(hook.data[field], hook);
67+
hook.data[field] = clean(hook.data[field]);
6868
}
6969
} catch (err) {
7070
hook.app.error(err);

server/services/contributions/hooks/metascraper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ module.exports = function () {
2222
const youtubeRegex = new RegExp(/(?:(?:https?:)?\/\/)?(?:www\.)?youtu(?:be\.com\/(?:watch\?(?:.*?&(?:amp;)?)*v=|v\/|embed\/)|\.be\/)([\w\-]+)(?:(?:&(?:amp;)?|\?)[\w\?=]*)*/, 'ig'); // eslint-disable-line
2323
const youtubeLinks = youtubeRegex.exec(hook.data.content);
2424

25+
// html link
26+
// const htmlLink = new RegExp(/<a\s[^>]*href=\"([^\"]*)\"[^>]*>(.*)<\/a>/, 'ig'); // eslint-disable-line
27+
2528
// here you could scrape the url for metadata
2629
// hook.app.debug('#6');
2730
// const { body: html, url } = await got(youtubeLinks[0]);

0 commit comments

Comments
 (0)