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

Weblab replace unsafe chars in uploaded image filenames #29245

Merged
merged 4 commits into from Jun 20, 2019

Conversation

davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented Jun 19, 2019

Background

Follow-on to #29222 . Finishes https://codedotorg.atlassian.net/browse/LP-438, for now. Also finishes https://codedotorg.atlassian.net/browse/STAR-480.

Description

When uploading images in weblab, replace any unsafe characters with dashes. This is a partial fix to a broader issue. This approach is relatively safe and self-contained, because the browser relies on the POST response to know what the filename is, so it doesn't have much chance to accidentally use the original, unsafe filename.

Caveats

This doesn't stop you from naming HTML files, or renaming image files, to contain unsafe characters via the weblab UI. That work is tracked by https://codedotorg.atlassian.net/browse/STAR-481

Screenshots

before/after screenshots in the asset manager are identical to #29222 . screenshots from within weblab are similar:

before

Screen Shot 2019-06-19 at 2 28 17 PM

after

Screen Shot 2019-06-19 at 2 28 32 PM

@davidsbailey davidsbailey changed the title Weblab replace unsafe chars Weblab replace unsafe chars in uploaded image filenames Jun 19, 2019
Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wahoo! Thanks Dave!

@davidsbailey davidsbailey merged commit c08ee23 into staging Jun 20, 2019
@davidsbailey davidsbailey deleted the weblab-replace-unsafe-chars branch June 20, 2019 05:17
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.

None yet

2 participants