From e3077b0ab0c83162130f59d91803002fdef25be6 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 21 Mar 2016 18:18:59 +0200 Subject: [PATCH] dont use titleEscaped if its empty --- src/notifications.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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;