Skip to content

a javascript error is reported on all overrided pages containing javascript with charaters (>,&,<) #230

Open
@mathieu-mbru

Description

Hello

a javascript error is reported on all overrided pages containing javascript with charaters (>,&,<)
Example
image
image
image
We have identified the cause that breaks the javascript code (which is encoded).
The cause is the following:
The view source or partial of type (Nokogiri::HTML::DocumentFragment) which encodes characters by calling the method to_s in (Module Applicator /method apply_overrides ) line 52 (source = doc.to_s) :
image
Since we trust views files and partials,
By replace this line :
source = doc.to_s
by this one :
source = doc.to_s.gsub('&lt;', '<').gsub('&gt;', '>').gsub('&amp;', '&')
The problem no longer exists
A PR was carried out on the subject #229
Thank you for considering this update.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions