mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +01:00
fix post export crashing if a pid reference doesn't resolve to an actual post object
This commit is contained in:
@@ -117,8 +117,8 @@ userController.exportPosts = function (req, res, next) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
// Convert newlines in content
|
||||
posts = posts.map(function (post) {
|
||||
// Remove empty post references and convert newlines in content
|
||||
posts = posts.filter(Boolean).map(function (post) {
|
||||
post.content = '"' + post.content.replace(/\n/g, '\\n').replace(/"/g, '\\"') + '"';
|
||||
return post;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user