v1.18.x
psychobunny 10 years ago
parent 92addc349b
commit 63a5002b53

@ -8,7 +8,7 @@ var async = require('async'),
meta = require('../meta'),
websockets = require('../socket.io'),
postTools = require('../postTools'),
plugins = require('../plugins')
plugins = require('../plugins');
module.exports = function(Posts) {
@ -61,6 +61,7 @@ module.exports = function(Posts) {
}
userData.custom_profile_info = results.customProfileInfo.profile;
userData.signature = sanitizeSignature(userData.signature);
plugins.fireHook('filter:posts.modifyUserInfo', userData, next);
});
@ -105,3 +106,18 @@ module.exports = function(Posts) {
});
};
};
function sanitizeSignature(signature) {
var string = require('string')(signature),
tagsToStrip = [];
if (parseInt(meta.config['signatures:disableLinks'], 10) === 1) {
tagsToStrip.push('a');
}
if (parseInt(meta.config['signatures:disableImages'], 10) === 1) {
tagsToStrip.push('img');
}
return tagsToStrip.length ? string.stripTags.apply(string, tagsToStrip).s : signature;
}
Loading…
Cancel
Save