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

Form titles with & not decoded properly #478

Closed
yanokwa opened this issue May 5, 2022 · 1 comment · Fixed by #550
Closed

Form titles with & not decoded properly #478

yanokwa opened this issue May 5, 2022 · 1 comment · Fixed by #550
Labels

Comments

@yanokwa
Copy link
Member

yanokwa commented May 5, 2022

If you put an & in the XLSForm title, Central’s UI/DB shows & while Enketo and Collect show the correct &.

xlsform
xlsform

central ui (and db)
central

xml
Screen Shot 2022-05-05 at 09 42 21

enketo
enketo

@matthew-white says...

Frontend just uses what it gets from the API, so I think it’d be an issue on central-backend. We probably just need to decode the text after we extract it from the XML.

If we don't already have tests, it'd also be good to add some tests for Unicode characters.

Potentially relevant: I vaguely remember that HTML documents don't support Unicode in the <title> tag.

@matthew-white
Copy link
Member

I wonder what the best place to do this decoding would be. We could do it in Form.fromXml() as a one-off change. But if we almost always want the decoded value in other cases as well, maybe it'd make sense to make this change in the text() XML utility function instead?

@matthew-white matthew-white changed the title Form titles with not decoded properly Form titles with &amp; not decoded properly May 5, 2022
@matthew-white matthew-white changed the title Form titles with &amp; not decoded properly Form titles with & not decoded properly May 5, 2022
@matthew-white matthew-white changed the title Form titles with & not decoded properly Form titles with & not decoded properly May 5, 2022
sadiqkhoja added a commit to sadiqkhoja/central-backend that referenced this issue Jul 28, 2022
sadiqkhoja added a commit to sadiqkhoja/central-backend that referenced this issue Jul 29, 2022
sadiqkhoja added a commit to sadiqkhoja/central-backend that referenced this issue Jul 29, 2022
sadiqkhoja added a commit to sadiqkhoja/central-backend that referenced this issue Aug 9, 2022
verify `GET formList` encodes form name correctly
sadiqkhoja added a commit to sadiqkhoja/central-backend that referenced this issue Aug 10, 2022
* entities:
  bug getodk#478: decode html entities in form title (getodk#550)
  bugfix: comment submission response format is bizarre (getodk#559)
  Run eslint on whole project (getodk#545)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants