mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
switched validator library out in favour of String lib
This commit is contained in:
@@ -4,7 +4,7 @@ var async = require('async'),
|
|||||||
winston = require('winston'),
|
winston = require('winston'),
|
||||||
cron = require('cron').CronJob,
|
cron = require('cron').CronJob,
|
||||||
nconf = require('nconf'),
|
nconf = require('nconf'),
|
||||||
validator = require('validator'),
|
S = require('string'),
|
||||||
|
|
||||||
db = require('./database'),
|
db = require('./database'),
|
||||||
utils = require('../public/src/utils'),
|
utils = require('../public/src/utils'),
|
||||||
@@ -36,14 +36,15 @@ var async = require('async'),
|
|||||||
notification.read = rank !== null ? true:false;
|
notification.read = rank !== null ? true:false;
|
||||||
|
|
||||||
// Backwards compatibility for old notification schema
|
// Backwards compatibility for old notification schema
|
||||||
|
// Remove this block when NodeBB v0.6.0 is released.
|
||||||
if (notification.hasOwnProperty('text')) {
|
if (notification.hasOwnProperty('text')) {
|
||||||
notification.bodyShort = notification.text;
|
notification.bodyShort = notification.text;
|
||||||
notification.bodyLong = '';
|
notification.bodyLong = '';
|
||||||
notification.text = validator.escape(notification.text);
|
notification.text = S(notification.text).escapeHTML().s;
|
||||||
}
|
}
|
||||||
|
|
||||||
notification.bodyShort = validator.escape(notification.bodyShort);
|
notification.bodyShort = S(notification.bodyShort).escapeHTML().s;
|
||||||
notification.bodyLong = validator.escape(notification.bodyLong);
|
notification.bodyLong = S(notification.bodyLong).escapeHTML().s;
|
||||||
|
|
||||||
if (notification.from && !notification.image) {
|
if (notification.from && !notification.image) {
|
||||||
User.getUserField(notification.from, 'picture', function(err, picture) {
|
User.getUserField(notification.from, 'picture', function(err, picture) {
|
||||||
|
|||||||
Reference in New Issue
Block a user