Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updater: Escape HTML characters in commit descriptions #9749

Conversation

Dentomologist
Copy link
Contributor

Escapes &<>'" characters in the "Update available" modal's short commit descriptions.

Before:
Before

After:
After

Fixes https://bugs.dolphin-emu.org/issues/12521

@Dentomologist Dentomologist force-pushed the escape_update_commit_descriptions branch from f314425 to 57f28b3 Compare May 24, 2021 19:35
@Dentomologist Dentomologist force-pushed the escape_update_commit_descriptions branch 2 times, most recently from 2f3d66a to c40366c Compare May 24, 2021 20:04
Comment on lines +678 to +683
for (const auto& [unescaped, escaped] : replacements)
{
html = ReplaceAll(html, unescaped, escaped);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted for readability over optimal performance here since anything that's generating HTML is unlikely to be on a hot path, but I'll change that if anyone wants me to.

Source/Core/Common/StringUtil.cpp Outdated Show resolved Hide resolved
@Dentomologist Dentomologist marked this pull request as draft June 2, 2021 00:01
@Dentomologist Dentomologist force-pushed the escape_update_commit_descriptions branch from e169065 to 99ed432 Compare June 2, 2021 00:24
@Dentomologist Dentomologist marked this pull request as ready for review June 2, 2021 00:40
@leoetlino leoetlino merged commit 3ef9d5f into dolphin-emu:master Jun 2, 2021
@Dentomologist Dentomologist deleted the escape_update_commit_descriptions branch June 2, 2021 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants