-
Notifications
You must be signed in to change notification settings - Fork 4.3k
(WIP) Fix TNL-3429. #11588
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
(WIP) Fix TNL-3429. #11588
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,11 +85,11 @@ if (is_proctored_exam) { | |
| <% } %> | ||
| <% if (xblockInfo.isVertical()) { %> | ||
| <span class="unit-title item-title"> | ||
| <a href="<%= xblockInfo.get('studio_url') %>"><%= xblockInfo.get('display_name') %></a> | ||
| <a href="<%= xblockInfo.get('studio_url') %>"><%- xblockInfo.get('display_name') %></a> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @agaylard For Underscore templates, there is no equivalent syntax for making the page safe by default. Instead, it should be understood that using Again, this isn't a requirement for this PR, but it certainly would be helpful if you want to wrap up that work. Of course, as you know, the Mako and underscore templates are related so if you escape here you need to make sure the data is not escaped when sent from Mako to JavaScript. |
||
| </span> | ||
| <% } else { %> | ||
| <span class="wrapper-<%= xblockType %>-title wrapper-xblock-field incontext-editor is-editable" data-field="display_name" data-field-display-name="<%= gettext("Display Name") %>"> | ||
| <span class="<%= xblockType %>-title item-title xblock-field-value incontext-editor-value"><%= xblockInfo.get('display_name') %></span> | ||
| <span class="<%= xblockType %>-title item-title xblock-field-value incontext-editor-value"><%- xblockInfo.get('display_name') %></span> | ||
| </span> | ||
| <% } %> | ||
| </h3> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agaylard - As @mushtaqak pointed out, we are moving toward making all templates "safe by default" by adding a page directive like you can see in index.html in this PR. Here's a comment about some things to look for if you make these changes.
As I noted earlier, more instructions will be coming and this will be a requirement in the future, but it isn't now. It's up to you if you want us to help chip away at this. However, it is important for you (and everyone) to understand that there is nothing special about this particular field, and we will want all fields to be escaped properly.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robrap Yeah sure. Whatever you need me to for this, I will gladly help out :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mushtaqak. I actually took care of this in a different PR.
FYI: the instructions for this will soon be available in Read the Docs, and they will have changed slightly for internationalization with
_()andHTML().