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

Scriptlet in GSP doesn't escape HTML text #16

Closed
nobeans opened this issue Feb 28, 2019 · 1 comment
Closed

Scriptlet in GSP doesn't escape HTML text #16

nobeans opened this issue Feb 28, 2019 · 1 comment

Comments

@nobeans
Copy link

nobeans commented Feb 28, 2019

<%= htmlText %> doesn't escape HTML text.

In a GSP file:

${"<font color='red'>EXPRESSION</font>"}
<%= "<font color='red'>SCRIPTLET</font>" %>

Result:
2019-02-28 20 18 05

It's because the configuration value in application.yml is wrong.
The correct key is scriptlet, but the current value is scriptlets.

https://github.com/grails-profiles/web/blob/master/skeleton/grails-app/conf/application.yml

grails:
  #...
    views:
        default:
            codec: html
        gsp:
            encoding: UTF-8
            htmlcodec: xml
            codecs:
                expression: html
                scriptlets: html    # This is wrong. The correct key is `scriptlet`
                taglib: none
                staticparts: none
@graemerocher
Copy link
Contributor

A PR would be welcome

graemerocher added a commit that referenced this issue Feb 28, 2019
Fixes #16 Replace 'scriptlets' with 'scriptlet'
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