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

When an Ampersand is used ("&") in the project title, it is escaped as html #1853

Closed
jzakotnik opened this issue May 29, 2024 · 3 comments · Fixed by #1860
Closed

When an Ampersand is used ("&") in the project title, it is escaped as html #1853

jzakotnik opened this issue May 29, 2024 · 3 comments · Fixed by #1860
Assignees
Labels
bug Something isn't working frontend Indicates frontend related issue or feature

Comments

@jzakotnik
Copy link
Contributor

image

@jzakotnik jzakotnik added bug Something isn't working frontend Indicates frontend related issue or feature labels May 29, 2024
@pmolnar-dev pmolnar-dev self-assigned this Jun 3, 2024
@galethil galethil added this to the Trubudget 2.12.0 milestone Jun 4, 2024
@pmolnar-dev
Copy link
Collaborator

@jzakotnik I would maybe suggest to forbid characters like "&" in the names of project, subprojects etc because we have to create helper function for that and basically paste it everywhere where the name with "&" is used across the app. The correct but more time consuming solution would be to add form validations to these forms so we can restrict user from entering these characters into these forms.

@jzakotnik
Copy link
Contributor Author

I don't quite get, what is the issue in saving an ampersand in the multichain and retrieve it again? Isn't it simply escaped?

@pmolnar-dev
Copy link
Collaborator

pmolnar-dev commented Jun 5, 2024

I don't know. :) I do know that it is a HTML entity and the problem is that it is invalid to write "&" in a text, in XML it even breaks the validation of the file. Honestly there is not one correct approach to this. The most straight forward solution is as I said. To create form validation and forbid these special characters. Ampersand should always be written as "&amp ;" so it translates to "&". In our app it does not work because the rule is applied twice, the double conversion error. At some point when text was entered, ampersand got converted to the sequence "&amp ;". It is not ampersand itself that is the problem. It is the website that takes user's input and does not always convert it correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Indicates frontend related issue or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants