Skip to content
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: Course title string in program detail page #594

Open
wants to merge 1 commit into
base: develop-koa
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ class CourseEntitlementView extends Backbone.View {
});
}

escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
}

handleEnrollChange() {
/*
Handles enrolling in a course, unenrolling in a session and changing session.
Expand Down
4 changes: 2 additions & 2 deletions lms/templates/learner_dashboard/course_card.underscore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<h5 class="course-title">
<% if (course_title_link) { %>
<a href="<%- course_title_link %>" class="course-title-link">
<%- title %>
<%- escapeHtml(title) %>
</a>
<% } else { %>
<%- title %>
<%- escapeHtml(title) %>
<% } %>
</h5>
<div class="course-text">
Expand Down