From e75ec97049755d0f41e3657b2ec1735334a0abf7 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 11 May 2015 12:20:58 -0400 Subject: [PATCH] closes #3121 -- if for any reason postData.content is not a string, make sure it is a string before it hits plugins. --- src/posts/parse.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/posts/parse.js b/src/posts/parse.js index d2f3278aca..486c961554 100644 --- a/src/posts/parse.js +++ b/src/posts/parse.js @@ -15,6 +15,11 @@ module.exports = function(Posts) { return callback(null, postData); } + // Casting post content into a string, just in case + if (typeof postData.content !== 'string') { + postData.content = postData.content.toString(); + } + plugins.fireHook('filter:parse.post', {postData: postData}, function(err, data) { if (err) { return callback(err);