-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix getSubject encoding #9476
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
Fix getSubject encoding #9476
Conversation
That's a nice temporary workaround, but shouldn't a proper fix prevent the special characters from getting encoded in the first place? |
Thank you for your submission @PieterCappelle! Have you seen this happening some place else? I'm going to review this and get back to you once I have some feedback. |
Hi @miguelbalparda And, a bit off-topic, it seems to be customary to move the pull request to "Review In Progress" if you started reviewing. The "Response Needed" seems to mean that you require additional information prior to proceeding with the PR. |
I want to know if he experienced this issue in a different area so we can add some more code before merging. |
I am very sorry to be bothering you, but your answer still has me puzzled. I just don't see, what kind of a different area would be relevant in this case and there should be an attempt to put in "some more code"? Is there some kind of a limit? |
Do I have to do anything right now? Is everything clear? |
Hi @PieterCappelle! All good, my original question is still valid but I'm still processing this PR. Thanks! |
@miguelbalparda No didn't see that anywhere else. Only problem occurs in subject of e-mails I think. |
What do you think about doing the same inside here? |
@miguelbalparda, it's not just the variables where the special characters might appear, it's the whole subject. Here's an example. Besides, having special characters escaped inside the body is okay as long the email template has |
I'm trying to apply this fix to the entire email and not only to the subject. Since we now know this might happen some place else, it might be a good idea to try to apply this in a more general way instead of only in one particular issue. |
In such case it would better to change the default for the {{trans }} and/or {{var }} directives from "|escape" to "|raw". That would at least keep the escaping wherever it is requested by the template explicitly (meaning: intentionally). However, there might be security considerations. All these variables are being escaped by default for a reason: they might very well contain malicious user-generated content. |
Hi @PieterCappelle thanks for the pull request. Would you mind trialling something like
which should allow utf-8 characters to be part of the subject line - it's something I use in EmailAttachments |
So apparently there is already a different fix merged into Maybe notify a bit sooner next time (in order to prevent people from wasting effort on a pull request which won't be merged)? |
@PieterCappelle Unfortunately other fix for the same issue is already delivered into the @korostii We try, but not always succeed in keeping track of the fixes coming through different channels, I am as concerned about wasting effort as everyone else. |
Fix for issues #6597 & #8094. Short description: If your store name has a special character in it, such as an apostrophe, it will be converted to a numerical character reference in any email subject. This will fix that problem.
Contribution checklist