Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e0863449f |
@@ -99,6 +99,11 @@ try {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Persist the trimmed text (not the raw client value) — matches update_comment.php
|
||||||
|
// and keeps stored comment_text free of leading whitespace that could shift a
|
||||||
|
// markdown-enabled comment's first line out of column 0 on reload.
|
||||||
|
$data['comment_text'] = $commentTextRaw;
|
||||||
|
|
||||||
// Never trust a client-supplied display name — always attribute the comment to
|
// Never trust a client-supplied display name — always attribute the comment to
|
||||||
// the authenticated session user.
|
// the authenticated session user.
|
||||||
$data['user_name'] = $currentUser['display_name'] ?? $currentUser['username'] ?? 'User';
|
$data['user_name'] = $currentUser['display_name'] ?? $currentUser['username'] ?? 'User';
|
||||||
|
|||||||
@@ -1219,7 +1219,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
if (typeof parseMarkdown === 'function') {
|
if (typeof parseMarkdown === 'function') {
|
||||||
list.querySelectorAll('.comment-text[data-markdown]').forEach(function (el) {
|
list.querySelectorAll('.comment-text[data-markdown]').forEach(function (el) {
|
||||||
if (!el.dataset.rendered) {
|
if (!el.dataset.rendered) {
|
||||||
el.innerHTML = parseMarkdown(el.textContent);
|
el.innerHTML = parseMarkdown(el.textContent.trim());
|
||||||
el.dataset.rendered = '1';
|
el.dataset.rendered = '1';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user