single tick fix

This commit is contained in:
2026-01-27 16:11:18 +01:00
parent fbc1c220cc
commit 1e0c246467
2 changed files with 3 additions and 5 deletions

View File

@@ -125,8 +125,7 @@ class UserCommentSystem {
safe = safe safe = safe
.replace(/&/g, "&") .replace(/&/g, "&")
.replace(/</g, "&lt;") .replace(/</g, "&lt;")
.replace(/"/g, "&quot;") .replace(/"/g, "&quot;");
.replace(/'/g, "&#039;");
const renderer = new marked.Renderer(); const renderer = new marked.Renderer();
renderer.blockquote = function (quote) { renderer.blockquote = function (quote) {
@@ -179,9 +178,8 @@ class UserCommentSystem {
return unsafe return unsafe
.replace(/&/g, "&amp;") .replace(/&/g, "&amp;")
.replace(/</g, "&lt;") .replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;") .replace(/"/g, "&quot;")
.replace(/'/g, "&#039;"); .replace(/>/g, "&gt;");
} }
} }

View File

@@ -133,7 +133,7 @@ export default (router, tpl) => {
if (isJson) { if (isJson) {
return res.reply({ return res.reply({
headers: { 'Content-Type': 'application/json; charset=utf-8' }, headers: { 'Content-Type': 'application/json; charset=utf-8' },
body: JSON.stringify({ success: true, comments: processedComments }) body: JSON.stringify({ success: true, comments: comments })
}); });
} }