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

Reserved Names for Windows Files can be used in ShapesLab #1844

Closed
ChesterSng opened this issue Apr 4, 2019 · 2 comments
Closed

Reserved Names for Windows Files can be used in ShapesLab #1844

ChesterSng opened this issue Apr 4, 2019 · 2 comments

Comments

@ChesterSng
Copy link
Contributor

ChesterSng commented Apr 4, 2019

Refer to this link for a list of reserved names for windows files.

Currently ShapesLab lets users choose their own category name which in turn will create a folder with the same category name. Since the creation of the folder is not done by the default "Create a Folder" by windows, reserved names can be entered into the category name and cause ShapesLab to stop working.

We should ban reserved words to be used as category names, an example will be "COM1" , when entered will cause an error to be thrown.

The category is added, however the directory cannot be created. Whenever users try to access the category "COM1" subsequently, an error will be thrown.

I did a check on the other labs and no other labs have a similar workflow that can cause this problem.

This post on StackOverflow can help.

Another way is to create the directory first, then catch the exception.

@ChesterSng ChesterSng changed the title Reserved Names for Windows Files Reserved Names for Windows Files can be used in ShapesLab Apr 4, 2019
@leeyh20
Copy link
Contributor

leeyh20 commented Apr 4, 2019

Interesting issue!

@EliasRojasC
Copy link
Contributor

I'd like to give this a shot. Could you give me a place to start? I'm new to the project.

ChesterSng pushed a commit that referenced this issue Apr 15, 2019
#1845)

* Added check to Reserved filenames in shapelab.

Added the check to the category creation in shape lab to not cause errors in file creation.

* Added reserved file names to invalidchars Regex

Added the Windows reserved file names to the invalid chars regular expression and added the reserved file names to the error message.

* Removed odd .htm file

Just deleted it.

* Added case insensitivity

Added a term to the regex so that it does not care about case.

* Fixed the Regex so that all cases are recognized

The regex to prevent windows reserved file names was fixed so that all cases and terms are matched.

* Deleted Comment

Self explanatory.

* Removed unnecessary using
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants