Updating link search and adding settings in admin panel.

This commit is contained in:
David Jay
2017-03-03 15:44:03 -05:00
parent cb88f0a9b7
commit 2e5d453ea7
5 changed files with 24 additions and 1 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ const errors = require('../../errors');
const AssetsService = require('../../services/assets');
const ActionsService = require('../../services/actions');
const CommentsService = require('../../services/comments');
const linkify = require('linkify-it')();
const Wordlist = require('../../services/wordlist');
@@ -162,7 +163,7 @@ const createPublicComment = (context, commentInput) => {
}
// If the comment contains a link.
if (settings.premodLinksEnable && /\S+\.\S+/.exec(comment.body)) {
if (settings.premodLinksEnable && linkify.test(comment.body)) {
return ActionsService.insertUserAction({
item_id: comment.id,
item_type: 'COMMENTS',