mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
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
@ -10,8 +10,8 @@ module.exports = (bot) => {
|
||||
try {
|
||||
const response = await axios.get('https://quotes-api-self.vercel.app/quote');
|
||||
const data = response.data;
|
||||
const escapedQuote = data.quote.replace(/([_*~`>.!-])/g, '\\$1');
|
||||
const escapedAuthor = `- ${data.author}.`.replace(/([_*~`>.!-])/g, '\\$1');
|
||||
const escapedQuote = data.quote.replace(/([\\_*~`>.!-])/g, '\\$1');
|
||||
const escapedAuthor = `- ${data.author}.`.replace(/([\\_*~`>.!-])/g, '\\$1');
|
||||
const escapedData = `${Strings.quoteResult}\n>*${escapedQuote}*\n_${escapedAuthor}_`;
|
||||
|
||||
ctx.reply(escapedData, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user