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

fix: escape comma #460

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mertalev
Copy link

@mertalev mertalev commented Oct 7, 2024

What is the purpose of this pull request?

escape doesn't currently escape commas, meaning that paths containing commas can unexpectedly change the glob pattern.

What changes did you make? (Give an overview)

I changed the regex to handle commas.

@mrmlnc
Copy link
Owner

mrmlnc commented Nov 23, 2024

Tell me a little bit more about the problem. In which cases does the comma break the pattern?

The current test checks a hypothetical case. I would like the tests in utils/path.spec.ts to check the real case.

@etnoy
Copy link

etnoy commented Dec 23, 2024

@mertalev are you referring to this PR of mine in immich? immich-app/immich#13259

In that case, we were able to use the escape path function to solve this. (the relevant change is in the bottom of the storage repository)

More serious seems to be the lack of escaping characters like " ' ` which we solved by manually escaping it after running escapePath: immich-app/immich#14856

We have to do escapePath(pathToCrawl).replaceAll('"', '["]').replaceAll("'", "[']").replaceAll('', '[]') to make it work

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.

3 participants