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

XML Entities not handled correctly #11

Closed
UlrichLohrmann opened this issue May 19, 2023 · 2 comments · Fixed by #12
Closed

XML Entities not handled correctly #11

UlrichLohrmann opened this issue May 19, 2023 · 2 comments · Fixed by #12
Assignees
Milestone

Comments

@UlrichLohrmann
Copy link

We have html:submit fields that have XML Entities for German Umlaut in the value of the value attribute, for example

<html:submit property="..." value="Zurück"/>

The ü XML Entity should display German Umlaut ü on the page but instead the XML text is "Zur%uuml;ck" without replacing the XML Entity ü with German Umlaut ü.

The reason is that during rendering of the value of the value property the TagUtils.getInstance().filter(..) method is called which calls ResponseUtils.filter(). In ResponseUtils.filter() the input string is examined and if a '&' is found it is prepended with &. So in my case the input value of ResponseUtils.filter is "Zurück" and the return is "Zur&aml;ück" and as a result the ü XML Entity is not replaced with the German Umlaut.

From my point of view, the ResponseUtils.filter class should have a list of valid XML entities that are accepted and not escaped, so that the result string does not contain the XML Entity but the expected text.

@ste-gr ste-gr self-assigned this May 20, 2023
@ste-gr
Copy link
Member

ste-gr commented Jun 29, 2023

Hallo Ulrich,

in the next Version (end of July I think) we would adapt the ResponseUtils.filter in such a way that the following string-parts

  • & [a-zA-Z][0-9a-zA-Z]* ;
  • &# [0-9]+ ;
  • &#x [0-9a-fA-F]+ ;

are also not filtered.

For example, the values Zur&uuml;ck or Footnote &sup1; are then taken over unchanged.

Greetings
Stefan

@ste-gr ste-gr linked a pull request Jul 7, 2023 that will close this issue
ste-gr added a commit that referenced this issue Oct 22, 2023
bugfix for issue #11 (skip xml entities in filter method)
@ste-gr ste-gr added this to the 1.4.5 milestone Oct 22, 2023
@ste-gr
Copy link
Member

ste-gr commented Nov 3, 2023

Hi @UlrichLohrmann,

I have released the new version 1.4.5, in which your problem is solved. I have also added a new sample page (apps/examples/src/main/webapp/exercise/html-button.jsp) to test this issue.

Greetings
Stefan

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 a pull request may close this issue.

3 participants