Skip to content

Improve JS course key validation to not allow special chars. - #28

Closed
mtyaka wants to merge 95 commits into
content-librariesfrom
mtyaka/validate-chars
Closed

Improve JS course key validation to not allow special chars. #28
mtyaka wants to merge 95 commits into
content-librariesfrom
mtyaka/validate-chars

Conversation

@mtyaka

@mtyaka mtyaka commented Jan 8, 2015

Copy link
Copy Markdown
Member

Background: Existing JS validation on new course and library forms prevents the user from submitting course/library keys that contain special characters, but it fails to detect these special characters: !'()*.
Discussions: The issue was discovered by @catong while reviewing #23 (diff)
Affected Components: Studio
Test Instructions: Go to the Studio home page and click the 'New Course' button to display the new course form. Put a string containing one of the special !'()* characters in any of 'Organization', 'Course Number', or 'Course Run' fields. Without this patch, the JS validation will fail to detect the special characters and will let you submit the form. Course creation will fail on the server because special characters are not allowed in these fields. With this patch enabled, JS validation will detect the special characters and will not let you submit the form (see screenshot).

screen shot 2015-01-09 at 08 50 28

@mtyaka mtyaka changed the title Mtyaka/validate chars Ensure course/library keys don't contain !'()* chars. Jan 8, 2015
@mtyaka
mtyaka force-pushed the mtyaka/validate-chars branch from 11cf572 to b9bab9b Compare January 8, 2015 15:10
@mtyaka
mtyaka force-pushed the mtyaka/validate-chars branch from b9bab9b to 84fd78e Compare January 9, 2015 07:31
@mtyaka mtyaka changed the title Ensure course/library keys don't contain !'()* chars. Improve JS course key validation to not allow special chars. Jan 9, 2015
awais786 and others added 11 commits January 9, 2015 15:17
In inline discussion if we have two discussion module the
new post button open form for both discussions as well as
cancel button of one discussion call the cancel of other.
Click and button actions are now being handled inside view
of each module so that they don't disturb eachother.

TNL-776
…ified-courses' into aamir-khan/ECOM-528-donation-verified-courses

Conflicts:
	common/djangoapps/student/tests/test_recent_enrollments.py
This hotfix patches the functionality of the GridFS PR
by dismissing the error msg when the user uploads a large
file and fails, then uploads a regular file. This
includes a Jasmine test to cover this case.
Don Mitchell and others added 9 commits January 12, 2015 10:42
of dangling children references to blocks.
TNL-1141
…-verified-courses

Aamir khan/ecom 528 donation verified courses
Fix flakiness on annotation selenium test
…r-khan/ECOM-335-caching-api into this branch.
…-update

Update translations (autogenerated message)
Stephen Sanchez and others added 24 commits January 14, 2015 08:56
Improve Django Admin Panel for Admin Roles.
Fix i18n from Destination team pages
…rt-command

Fix email_opt_in_list export command to parse options correctly.
Fix visual bug with large file error msg in cms.
edX Solutions Team: Default LMS security settings changes (Matasano)
Adding the Enrollment API as a Django App in LMS.
…ngs-fontawesome

FIX - Studio: resolving xblock warning messages icons
Fix pep8 violations in common.py
…ent-plurality

Fixed pluralization of matching problems in Library Content Module.
…tests

add test security settings to bokchoy envs
Co-Authored-By: Jean-Michel Claus <jmc@edx.org>
Co-Authored-By: Brian Talbot <btalbot@edx.org>
Co-Authored-By: Tim Babych <tim@edx.org>
Co-Authored-By: Oleg Marshev <oleg@edx.org>
Co-Authored-By: Chris Rodriguez <crodriguez@edx.org>
Add help tokens: cohort courses & content libraries
Logger: Add possibility to send sync requests.
Course and Library keys cannot contiain !'()* special characters,
but the JS validation on the new course/library failed to detect
these characters.

`encodeURIComponent` is used to check the string for special characters,
but `encodeURIComponent` does not encode these characters: -_!~*'().
(see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent)

The -_~ characters are allowed in course keys, but !'()* are not,
so add an explicit check for these characters to make sure a field
containing these characters does not pass the validation.
@mtyaka

mtyaka commented Jan 15, 2015

Copy link
Copy Markdown
Member Author

@mtyaka mtyaka closed this Jan 15, 2015
@mtyaka
mtyaka deleted the mtyaka/validate-chars branch January 8, 2016 08:01
clemente pushed a commit that referenced this pull request Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.