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

replace / with _ in beer names #40

Closed
wants to merge 1 commit into from

Conversation

vanosg
Copy link
Collaborator

@vanosg vanosg commented Jul 11, 2014

Issue #29
We use the beer name as part of the file path for saving data... no problems there if we use MyBeer as a name,
the path is /path/to/MyBeer . However, if we use My/Beer as the name, the filepath becomes /path/to/My/Beer and
breaks everything. We simply replace / with _ to avoid this problem. Note- Windows has a TON of restricted chars
and COMBOS of chars that are restricted, but not addressed in this patch.

Issue BrewPi#29
We use the beer name as part of the file path for saving data... no problems there if we use MyBeer as a name,
the path is /path/to/MyBeer . However, if we use My/Beer as the name, the filepath becomes /path/to/My/Beer and
breaks everything. We simply replace / with _ to avoid this problem. Note- Windows has a TON of restricted chars
and COMBOS of chars that are restricted, but not addressed in this patch.
@elcojacobs
Copy link
Member

The names are escaped in the web interface now. Should we still do it here?

@vanosg
Copy link
Collaborator Author

vanosg commented Aug 5, 2014

You can do it either way... I'm probably biased b/c I dont do web stuff, but I think you'd want to do it here, or atleast check it here, at minimum just to serve as a reminder that sanitization is being done on it (when something else breaks). I think a 'new person' to the code's first intuition would be to check here.

But, I am biased! I don't think there's a wrong answer.

@elcojacobs
Copy link
Member

I agree that escaping the slash is a sound idea, even if it is done elsewhere too. Can you submit this pull request against develop instead?

@vanosg
Copy link
Collaborator Author

vanosg commented Mar 23, 2015

Done! Closing.

@vanosg vanosg closed this Mar 23, 2015
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.

2 participants