Skip to content

Commit

Permalink
Merge pull request ninenine#40 from NodeBB-Community/master
Browse files Browse the repository at this point in the history
fix: dont crash if content is not string
  • Loading branch information
ninenine authored Jun 12, 2023
2 parents e3121b3 + 0b1ff76 commit 97c1b16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parseContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function parseContent(content, banned_words, banned_urls, censorWholeWord, symbo
}

var replacement = censorWholeWord ? '[censored]' : censor;
return content
return String(content)
.replace(banned_words, replacement)
.replace(banned_urls, '[link removed]');
}
Expand Down

0 comments on commit 97c1b16

Please sign in to comment.