mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 20:41:17 +01:00
@@ -215,11 +215,7 @@
|
||||
if (value) {
|
||||
var variable;
|
||||
for (var i = 1, ii = variables.length; i < ii; i++) {
|
||||
|
||||
// see https://github.com/NodeBB/NodeBB/issues/1951
|
||||
variables[i] = variables[i].replace(/%/g, '%').replace(/,/g, ',');
|
||||
|
||||
variable = S(variables[i]).chompRight(']]').collapseWhitespace().escapeHTML().s;
|
||||
variable = S(variables[i]).chompRight(']]').collapseWhitespace().decodeHTMLEntities().escapeHTML().s;
|
||||
value = value.replace('%' + i, variable);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,9 @@ module.exports = function(Topics) {
|
||||
|
||||
Topics.notifyFollowers = function(postData, exceptUid, callback) {
|
||||
callback = callback || function() {};
|
||||
var followers, title;
|
||||
var followers;
|
||||
var title;
|
||||
var titleEscaped;
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
@@ -126,12 +128,14 @@ module.exports = function(Topics) {
|
||||
return callback();
|
||||
}
|
||||
title = postData.topic.title;
|
||||
|
||||
if (title) {
|
||||
title = S(title).decodeHTMLEntities().s;
|
||||
titleEscaped = title.replace(/%/g, '%').replace(/,/g, ',');
|
||||
}
|
||||
|
||||
notifications.create({
|
||||
bodyShort: '[[notifications:user_posted_to, ' + postData.user.username + ', ' + title + ']]',
|
||||
bodyShort: '[[notifications:user_posted_to, ' + postData.user.username + ', ' + titleEscaped + ']]',
|
||||
bodyLong: postData.content,
|
||||
pid: postData.pid,
|
||||
nid: 'new_post:tid:' + postData.topic.tid + ':pid:' + postData.pid + ':uid:' + exceptUid,
|
||||
@@ -162,7 +166,7 @@ module.exports = function(Topics) {
|
||||
emailer.send('notif_post', toUid, {
|
||||
pid: postData.pid,
|
||||
subject: '[' + (meta.config.title || 'NodeBB') + '] ' + title,
|
||||
intro: '[[notifications:user_posted_to, ' + postData.user.username + ', ' + title + ']]',
|
||||
intro: '[[notifications:user_posted_to, ' + postData.user.username + ', ' + titleEscaped + ']]',
|
||||
postBody: postData.content.replace(/"\/\//g, '"http://'),
|
||||
site_title: meta.config.title || 'NodeBB',
|
||||
username: data.userData.username,
|
||||
|
||||
Reference in New Issue
Block a user