[AB-216] replacing js_string with json_string in order to escape characters, because js_string could lead to illegal escape sequences

This commit is contained in:
Sheldan
2021-03-28 17:12:08 +02:00
parent 26879b7952
commit 83ec7fc4cd
37 changed files with 76 additions and 76 deletions

View File

@@ -14,6 +14,6 @@
}
]
<#if roles?size gt 0>
,"additionalMessage": "<#list roles as role>${role.role.asMention?js_string}<#sep>,</#list>"
,"additionalMessage": "<#list roles as role>${role.role.asMention?json_string}<#sep>,</#list>"
</#if>
}

View File

@@ -6,7 +6,7 @@
},
<#include "modmail_color">,
<#if postedMessage.contentRaw?has_content>
"description": "${postedMessage.contentRaw?js_string}"
"description": "${postedMessage.contentRaw?json_string}"
</#if>
<#if postedMessage.attachments?size gt 0>
<#if postedMessage.contentRaw?has_content>,</#if>
@@ -14,6 +14,6 @@
</#if>
<#if subscribers?size gt 0>
<#if postedMessage.contentRaw?has_content || postedMessage.attachments?size gt 0>,</#if>
"additionalMessage": "<#list subscribers as subscriber>${subscriber.member.asMention?js_string}<#sep>,</#list>"
"additionalMessage": "<#list subscribers as subscriber>${subscriber.member.asMention?json_string}<#sep>,</#list>"
</#if>
}

View File

@@ -3,7 +3,7 @@
<@member_author member=author/>,
<#include "modmail_color">
<#if message.embeds[0].description?has_content>
,"description": "${message.embeds[0].description?js_string}"
,"description": "${message.embeds[0].description?json_string}"
</#if>
<#if message.embeds[0].image?has_content>
,"imageUrl": "${message.embeds[0].image.proxyUrl}"

View File

@@ -1,4 +1,4 @@
{
<#include "modmail_color">,
"description": "${closingMessage?js_string}"
"description": "${closingMessage?json_string}"
}

View File

@@ -6,7 +6,7 @@
},
<#include "modmail_color">
<#if text?has_content>
, "description": "${text?js_string}"
, "description": "${text?json_string}"
</#if>
<#if postedMessage.attachments?size gt 0>
,"imageUrl": "${postedMessage.attachments[0].proxyUrl}"

View File

@@ -4,6 +4,6 @@
<#include "modmail_color">,
<#assign user><@member_user_name member=member/> (${member.user.id})</#assign>
<#assign joinDate>${member.timeJoined}</#assign>
<#assign roles><#list member.roles as role>${role.asMention?js_string}<#sep>,<#else><@safe_include "modmail_thread_header_no_roles"/></#list></#assign>
<#assign roles><#list member.roles as role>${role.asMention?json_string}<#sep>,<#else><@safe_include "modmail_thread_header_no_roles"/></#list></#assign>
"description": "<@safe_include "modmail_thread_header_embed_description"/>"
}