-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add escaping of js translation version #10904
Conversation
1a37fde
to
7d74feb
Compare
7d74feb
to
f2c8a75
Compare
Sorry, does not sound reasonable to me :) One can put some Such approach means we shall escape output of EVERY public non-final method as it can be pluginized. I'll tell you more, Cc: @ishakhsuvarov @hostep since you liked the idea, please share your thoughts. I may be a bit out of context. |
@orlangur: I think if a value is outputted in a javascript string, it should be escaped, so if the value contains single quotes, it won't break the javascript. This is not really to prevent injecting other javascript code to be executed, but in this case, so that the |
@hostep ok, thanks, that's a bit closer to reality, just I'm not sure if there are actually some hash functions with single quotes in output. Generally I'm a bigger fan of "escape everything by default" approach, like Twig does, not sure why Magento picked up an opposite approach. |
As it was discussed in #10378 (comment) - we need to escape js translation version.
Description
Previously value of $version variable was always sha1, that can be not escaped, but from now it uses raw value from public method, that could be overridden by plugin.
Fixed Issues (if relevant)
N/A
Manual testing scenarios
Actual result:
Expected result:
Contribution checklist