mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
IRCClient: Escape HTML entities in nicknames, too, just in case
This commit is contained in:
parent
68e23bca3f
commit
d6f9349f15
Notes:
sideshowbarker
2024-07-19 11:20:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d6f9349f15d
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ static String timestamp_string()
|
||||||
|
|
||||||
void IRCLogBuffer::add_message(char prefix, const String& name, const String& text, Color color)
|
void IRCLogBuffer::add_message(char prefix, const String& name, const String& text, Color color)
|
||||||
{
|
{
|
||||||
auto nick_string = String::format("<%c%s> ", prefix ? prefix : ' ', name.characters());
|
auto nick_string = String::format("<%c%s> ", prefix ? prefix : ' ', name.characters());
|
||||||
auto html = String::format(
|
auto html = String::format(
|
||||||
"<div style=\"color: %s\">"
|
"<div style=\"color: %s\">"
|
||||||
"<span>%s</span>"
|
"<span>%s</span>"
|
||||||
|
@ -53,7 +53,7 @@ void IRCLogBuffer::add_message(char prefix, const String& name, const String& te
|
||||||
"</div>",
|
"</div>",
|
||||||
color.to_string().characters(),
|
color.to_string().characters(),
|
||||||
timestamp_string().characters(),
|
timestamp_string().characters(),
|
||||||
nick_string.characters(),
|
escape_html_entities(nick_string).characters(),
|
||||||
escape_html_entities(text).characters());
|
escape_html_entities(text).characters());
|
||||||
auto fragment = parse_html_fragment(*m_document, html);
|
auto fragment = parse_html_fragment(*m_document, html);
|
||||||
m_container_element->append_child(fragment->remove_child(*fragment->first_child()));
|
m_container_element->append_child(fragment->remove_child(*fragment->first_child()));
|
||||||
|
|
Loading…
Reference in a new issue