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

[MP-1010] Fix ampersand in email_subject_room_name #12

Open
wants to merge 1 commit into
base: sa_patches_3.6.0
Choose a base branch
from

Conversation

dasha140132
Copy link

No description provided.

@dasha140132 dasha140132 force-pushed the mp_1010_fix_ampersands_in_email_subject_room_name branch 2 times, most recently from 66305f1 to 5860f15 Compare October 22, 2020 13:04
@dasha140132 dasha140132 force-pushed the mp_1010_fix_ampersands_in_email_subject_room_name branch from 5860f15 to e4c4b1c Compare October 25, 2020 14:17
Copy link

@nmagedman nmagedman left a comment

Choose a reason for hiding this comment

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

Thank you, but this doesn't feel like it's the right approach. We have a mixing of concerns (both in upstream's code and in this patch) where replacekey (and by extension replace) is doing two unrelated things:

  1. It is expanding placeholders in a template string.
  2. It is HTML-escaping the template values.

I prefer that we separate these concerns. replace/replacekeys should only do text substitution. The caller should handle any escaping before passing in data/value. If needed, we can have another helper function that escapes all the values in an object, which we could compose with replace().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants