From aedccbcb3eba9684fa90cd3bbc04903d9dfb47a3 Mon Sep 17 00:00:00 2001 From: jysperm Date: Sun, 26 Oct 2014 20:06:41 +0800 Subject: [PATCH] fix bug: don't trim before update reply --- controllers/reply.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/reply.js b/controllers/reply.js index 0d00693..095d72b 100644 --- a/controllers/reply.js +++ b/controllers/reply.js @@ -143,8 +143,8 @@ exports.update = function (req, res, next) { if (String(reply.author_id) === req.session.user._id.toString() || req.session.user.is_admin) { - reply.content = content.trim(); - if (content.length > 0) { + if (content.trim().length > 0) { + reply.content = content; reply.save(function (err) { if (err) { return next(err);