Skip to content

[MP-1010] Fix ampersand in email_subject_room_name#12

Open
dasha140132 wants to merge 1 commit intosa_patches_3.6.0from
mp_1010_fix_ampersands_in_email_subject_room_name
Open

[MP-1010] Fix ampersand in email_subject_room_name#12
dasha140132 wants to merge 1 commit intosa_patches_3.6.0from
mp_1010_fix_ampersands_in_email_subject_room_name

Conversation

@dasha140132
Copy link

No description provided.

@dasha140132 dasha140132 requested a review from nmagedman October 22, 2020 10:45
@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

Development

Successfully merging this pull request may close these issues.

2 participants