Skip to content

Commit 096bfe9

Browse files
authored
Merge pull request #223 from edx/IM/security-fixes-12
Incident Management Security Fixes 12
2 parents d0d5cd7 + f87507b commit 096bfe9

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div class="wrapper-comp-setting">
2-
<label class="label setting-label" for="<%= uniqueId %>"><%= model.get('display_name') %></label>
3-
<input class="input setting-input setting-input-number" type="number" id="<%= uniqueId %>" value='<%= model.get("value") %>'/>
4-
<button class="action setting-clear inactive" type="button" name="setting-clear" value="<%= gettext("Clear") %>" data-tooltip="<%= gettext("Clear") %>">
5-
<span class="icon fa fa-undo" aria-hidden="true"></span><span class="sr">"<%= gettext("Clear Value") %>"</span>
2+
<label class="label setting-label" for="<%- uniqueId %>"><%- model.get('display_name') %></label>
3+
<input class="input setting-input setting-input-number" type="number" id="<%- uniqueId %>" value='<%- model.get("value") %>'/>
4+
<button class="action setting-clear inactive" type="button" name="setting-clear" value="<%- gettext("Clear") %>" data-tooltip="<%- gettext("Clear") %>">
5+
<span class="icon fa fa-undo" aria-hidden="true"></span><span class="sr">"<%- gettext("Clear Value") %>"</span>
66
</button>
77
</div>
8-
<span class="tip setting-help"><%= model.get('help') %></span>
8+
<span class="tip setting-help"><%- model.get('help') %></span>

cms/templates/js/video/transcripts/messages/transcripts-choose.underscore

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<div class="transcripts-message-status status-error">
22
<span class="icon fa fa-remove" aria-hidden="true"></span>
3-
<%= gettext("Timed Transcript Conflict") %>
3+
<%- gettext("Timed Transcript Conflict") %>
44
</div>
55

66
<p class="transcripts-message">
7-
<%= gettext("The timed transcript for the first video file does not appear to be the same as the timed transcript for the second video file.") %>
7+
<%- gettext("The timed transcript for the first video file does not appear to be the same as the timed transcript for the second video file.") %>
88
<strong>
9-
<%= gettext("Which timed transcript would you like to use?") %>
9+
<%- gettext("Which timed transcript would you like to use?") %>
1010
</strong>
1111
</p>
1212

1313
<p class="transcripts-error-message is-invisible">
14-
<%= gettext("Error.") %>
14+
<%- gettext("Error.") %>
1515
</p>
1616

1717
<div class="wrapper-transcripts-buttons">
@@ -28,12 +28,12 @@
2828
class="action setting-choose"
2929
type="button"
3030
name="setting-choose"
31-
data-video-id="<%= value %>"
32-
value="<%= message %>"
33-
data-tooltip="<%= message %>"
31+
data-video-id="<%- value %>"
32+
value="<%- message %>"
33+
data-tooltip="<%- message %>"
3434
>
3535
<span>
36-
<%= message %>
36+
<%= message %> <% // xss-lint: disable=underscore-not-escaped %>
3737
</span>
3838
</button>
3939
<% }) %>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<div class="transcripts-message-status"><span class="icon fa fa-check" aria-hidden="true"></span><%= gettext("Timed Transcript Found") %></div>
1+
<div class="transcripts-message-status"><span class="icon fa fa-check" aria-hidden="true"></span><%- gettext("Timed Transcript Found") %></div>
22
<p class="transcripts-message">
3-
<%= gettext("EdX has a timed transcript for this video. If you want to edit this transcript, you can download, edit, and re-upload the existing transcript. If you want to replace this transcript, upload a new .srt transcript file.") %>
3+
<%- gettext("EdX has a timed transcript for this video. If you want to edit this transcript, you can download, edit, and re-upload the existing transcript. If you want to replace this transcript, upload a new .srt transcript file.") %>
44
</p>
55
<div class="transcripts-file-uploader"></div>
66
<p class="transcripts-error-message is-invisible">
7-
<%= gettext("Error.") %>
7+
<%- gettext("Error.") %>
88
</p>
99
<div class="wrapper-transcripts-buttons">
10-
<button class="action setting-upload" type="button" name="setting-upload" value="<%= gettext("Upload New Transcript") %>" data-tooltip="<%= gettext("Upload New .srt Transcript") %>">
11-
<span><%= gettext("Upload New Transcript") %></span>
10+
<button class="action setting-upload" type="button" name="setting-upload" value="<%- gettext("Upload New Transcript") %>" data-tooltip="<%- gettext("Upload New .srt Transcript") %>">
11+
<span><%- gettext("Upload New Transcript") %></span>
1212
</button>
13-
<a class="action setting-download" href="/transcripts/download?locator=<%= component_locator %>" data-tooltip="<%= gettext("Download Transcript for Editing") %>">
14-
<span><%= gettext("Download Transcript for Editing") %></span>
13+
<a class="action setting-download" href="/transcripts/download?locator=<%- component_locator %>" data-tooltip="<%- gettext("Download Transcript for Editing") %>">
14+
<span><%- gettext("Download Transcript for Editing") %></span>
1515
</a>
1616
</div>

common/lib/xmodule/xmodule/block_metadata_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
BlockStructure.
77
"""
88

9+
from markupsafe import escape
10+
911

1012
def url_name_for_block(block):
1113
"""
@@ -77,4 +79,4 @@ def display_name_with_default_escaped(block):
7779
# This escaping is incomplete. However, rather than switching this to use
7880
# markupsafe.escape() and fixing issues, better to put that energy toward
7981
# migrating away from this method altogether.
80-
return display_name_with_default(block).replace('<', '&lt;').replace('>', '&gt;')
82+
return escape(display_name_with_default(block))

0 commit comments

Comments
 (0)