Skip to content

Quotes inside <script> elements get forcibly entity-escapedΒ #77

@julik

Description

@julik

At the moment the interception forcibly converts all quotes inside the content of script elements into &quot; entities. The following ERB:

<script type="application/json" id="timeline-data"><%== JSON.generate({hello: "world"}) %></script>

gets output like so with normal ERB:

<script type="application/json" id="timeline-data">{"hello":"world"}</script>

but with Reactionview intercepts the render is:

<script type="application/json" id="timeline-data">{&quot;hello&quot;:&quot;world&quot;}</script>

which predictably wrecks any downstream parsing. I've done a test with <script>alert(&quot;hello&quot;)</script> and that is obviously not working, so browsers don't decode those entities.

If this is done for security I would strongly urge to reconsider this approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingherb

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions