fix: 修复发版前代码质量问题
- 修复 functions.php 中 get_article_words() 函数的逻辑错误:循环中检查 $str 改为 $line - 修复 argontheme.js 中 reply() 函数的 null/undefined 访问风险:添加元素存在性检查 - 修复 argontheme.js 中潜在的 XSS 风险:使用 .text() 替代 .html() 输出用户内容 - 修复 functions.php 中 post_analytics_info() 使用 HTTP 改为 HTTPS - 删除临时分析文件(不应包含在发版中)
This commit is contained in:
@@ -932,12 +932,17 @@ if (argonConfig.waterflow_columns != "1") {
|
||||
cancelEdit(false);
|
||||
replying = true;
|
||||
replyID = commentID;
|
||||
$("#post_comment_reply_name").html($("#comment-" + commentID + " .comment-item-title > .comment-name")[0].innerHTML);
|
||||
let preview = $("#comment-" + commentID + " .comment-item-text")[0].innerHTML;
|
||||
if ($("#comment-" + commentID + " .comment-item-source")[0].innerHTML != ''){
|
||||
preview = $("#comment-" + commentID + " .comment-item-source")[0].innerHTML.replace(/\n/g, "</br>");
|
||||
let nameEl = $("#comment-" + commentID + " .comment-item-title > .comment-name")[0];
|
||||
let textEl = $("#comment-" + commentID + " .comment-item-text")[0];
|
||||
let sourceEl = $("#comment-" + commentID + " .comment-item-source")[0];
|
||||
if (nameEl) {
|
||||
$("#post_comment_reply_name").text(nameEl.textContent);
|
||||
}
|
||||
$("#post_comment_reply_preview").html(preview);
|
||||
let preview = textEl ? textEl.textContent : '';
|
||||
if (sourceEl && sourceEl.innerHTML !== '') {
|
||||
preview = sourceEl.textContent;
|
||||
}
|
||||
$("#post_comment_reply_preview").text(preview);
|
||||
if ($("#comment-" + commentID + " .comment-item-title .badge-private-comment").length > 0){
|
||||
$("#post_comment").addClass("post-comment-force-privatemode-on");
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user