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

Escaping Issues #316

Open
saraedum opened this issue Jun 11, 2019 · 4 comments
Open

Escaping Issues #316

saraedum opened this issue Jun 11, 2019 · 4 comments

Comments

@saraedum
Copy link

The implementation of readMulti builds the resulting URL by joining arguments with

let url = this.services.interpolator.interpolate(loadPath, { lng: languages.join('+'), ns: namespaces.join('+') });

This causes trouble for me when the namespace contains whitespaces as these can the not be recovered correctly on the backend.

More generally, this is problematic when the namespace contains anything that gets escaped by interpolate. Characters seem to get escaped as the HTML entities which is very confusing to parse on the backend since you would expect URL escaped arguments.

@jamuhl
Copy link
Member

jamuhl commented Jun 11, 2019

@saraedum
Copy link
Author

Thanks for the hint. Do you agree that things should be properly escaped as a default though?

@jamuhl
Copy link
Member

jamuhl commented Jun 11, 2019

got no opinion on that...namespaces should be simple - so your case is the first in 7 years...

backends are extra done as plugins to feel needs as user demand...personally I would completely remove multiload

@saraedum
Copy link
Author

This would for example be a problem if the namespace names are not in English (which makes sense if the default language is not English) or if they contain spaces. I agree that it's an unfortunate choice for namespaces to contain spaces…

Note that only the escaping of spaces is a problem in the multiload scenario. The general escaping of HTML entities is a problem in the normal code path as well.

Let me try to propose a PR to improve the situation and we can discuss things further :)

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

No branches or pull requests

2 participants