FIX: escape youtube title when constructing onebox preview html (#16999)

This commit is contained in:
Mayfield
2022-06-08 01:42:37 -04:00
committed by GitHub
parent 82ac698d4f
commit 99b0578b4c
2 changed files with 7 additions and 2 deletions

View File

@ -42,7 +42,7 @@ module Onebox
result = parse_embed_response
result ||= get_opengraph.data
"<img src='#{result[:image]}' width='#{WIDTH}' height='#{HEIGHT}' title='#{result[:title]}'>"
"<img src='#{result[:image]}' width='#{WIDTH}' height='#{HEIGHT}' title='#{CGI::escapeHTML(result[:title])}'>"
else
to_html
end