Skip to content

Node.js based forum software built for the modern web

dont use titleEscaped if its empty

barisusaklie3077b0ab0c8
diff --git a/src/notifications.js b/src/notifications.js
index 8e90e0d62f..498337a7db 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -106,7 +106,7 @@ var async = require('async'),
});
callback(null, _nids.filter(function(nid, idx) {
- return mergeIds.indexOf(sets[idx]) !== -1
+ return mergeIds.indexOf(sets[idx]) !== -1;
}));
});
};
@@ -452,11 +452,12 @@ var async = require('async'),
var title = S(notifications[modifyIndex].topicTitle || '').decodeHTMLEntities().s;
var titleEscaped = title.replace(/%/g, '%').replace(/,/g, ',');
+ titleEscaped = titleEscaped ? (', ' + titleEscaped) : '';
if (numUsers === 2) {
- notifications[modifyIndex].bodyShort = '[[' + mergeId + '_dual, ' + usernames.join(', ') + ', ' + titleEscaped + ']]';
+ notifications[modifyIndex].bodyShort = '[[' + mergeId + '_dual, ' + usernames.join(', ') + titleEscaped + ']]';
} else if (numUsers > 2) {
- notifications[modifyIndex].bodyShort = '[[' + mergeId + '_multiple, ' + usernames[0] + ', ' + (numUsers-1) + ', ' + titleEscaped + ']]';
+ notifications[modifyIndex].bodyShort = '[[' + mergeId + '_multiple, ' + usernames[0] + ', ' + (numUsers - 1) + titleEscaped + ']]';
}
break;