Skip to content
Snippets Groups Projects
Commit 0dcb6ece authored by Diego Millan's avatar Diego Millan Committed by Constanza Abarca
Browse files

Making the regex that gets the index courses more secure

parent 877168f7
No related merge requests found
......@@ -584,7 +584,7 @@ class CourseOverview(TimeStampedModel):
# In rare cases, courses belonging to the same org may be accidentally assigned
# an org code with a different casing (e.g., Harvardx as opposed to HarvardX).
# Case-insensitive matching allows us to deal with this kind of dirty data.
course_overviews = course_overviews.filter(org__iregex=r'(' + '|'.join(orgs) + ')')
course_overviews = course_overviews.filter(org__iregex=r'(^' + '$|^'.join(orgs) + '$)')
if filter_:
course_overviews = course_overviews.filter(**filter_)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment