Fix code scanning alert no. 5: Incomplete string escaping or encoding
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
parent
fc172854e1
commit
8be47db155
1 changed files with 2 additions and 2 deletions
|
@ -10,8 +10,8 @@ module.exports = (bot) => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get('https://quotes-api-self.vercel.app/quote');
|
const response = await axios.get('https://quotes-api-self.vercel.app/quote');
|
||||||
const data = response.data;
|
const data = response.data;
|
||||||
const escapedQuote = data.quote.replace(/([_*~`>.!-])/g, '\\$1');
|
const escapedQuote = data.quote.replace(/([\\_*~`>.!-])/g, '\\$1');
|
||||||
const escapedAuthor = `- ${data.author}.`.replace(/([_*~`>.!-])/g, '\\$1');
|
const escapedAuthor = `- ${data.author}.`.replace(/([\\_*~`>.!-])/g, '\\$1');
|
||||||
const escapedData = `${Strings.quoteResult}\n>*${escapedQuote}*\n_${escapedAuthor}_`;
|
const escapedData = `${Strings.quoteResult}\n>*${escapedQuote}*\n_${escapedAuthor}_`;
|
||||||
|
|
||||||
ctx.reply(escapedData, {
|
ctx.reply(escapedData, {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue