misc.search: more safeString

This commit is contained in:
Cynthia Foxwell 2023-01-17 20:56:35 -07:00
parent e90a6819a1
commit a7b68deedd

View file

@ -573,11 +573,11 @@ search.callback = async function (msg, line, args, {results = 2}) {
let out = `__**Results for \`${safeString(query)}\`**__\n`;
for (const result of searchResults) {
if (result.special_response) {
out += "> " + parseHtmlEntities(result.special_response.response.split("\n").join("\n> "));
out += "> " + safeString(parseHtmlEntities(result.special_response.response.split("\n").join("\n> ")));
out += `\n<${encodeURI(result.special_response.source)}>`;
} else {
out += `**${parseHtmlEntities(result.title)}** - <${encodeURI(result.url)}>`;
out += `\n> ${parseHtmlEntities(result.description)}`;
out += `**${safeString(parseHtmlEntities(result.title))}** - <${encodeURI(result.url)}>`;
out += `\n> ${safeString(parseHtmlEntities(result.description))}`;
}
out += "\n\n";
}