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

Removed "hasMagic" check before escaping paths. #4923

Closed
wants to merge 3 commits into from

Conversation

theodab
Copy link
Contributor

@theodab theodab commented Sep 2, 2020

Which issue, if any, is this issue related to?

Closes #4193

Is there anything in the PR that needs further explanation?

Globby's "hasMagic" function, which is meant to detect if a path
contains globbing characters, notably does not detect paths that
contain matched parentheses, unless those matched parentheses
have extra globbing characters attached to them. This is a problem
because globby requires matches parentheses to be escaped, if they
are part of the literal path.
This changes the part of the code that escapes paths that literally
exist to not check "hasMagic" first, to get around that oversight.
I'm not super knowledgeable about your codebase, so if you think this solution might break something somewhere else, feel free to request changes.

theodab and others added 3 commits September 2, 2020 14:14
Globby's "hasMagic" function, which is meant to detect if a path
contains globbing characters, notably does not detect paths that
contain matched parentheses, unless those matched parentheses
have extra globbing characters attached to them. This is a problem
because globby requires matches parentheses to be escaped, if they
are part of the literal path.
This changes the part of the code that escapes paths that literally
exist to not check "hasMagic" first, to get around that oversight.
Copy link
Member

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

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

Thanks @theodab, this looks good to me 👍

I've added a test for your case, and adjusted the comment.

@theodab
Copy link
Contributor Author

theodab commented Sep 9, 2020

Whoops. I just realized I shouldn't have made this PR from the master branch of my fork, for backwards compatibility reasons with old versions of Shaka Player.
Here's the new version of the PR: #4931

@theodab theodab closed this Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Allow to use full file path without converting it to glob
2 participants