spree / deface

Rails plugin that allows you to customize ERB views in a Rails application without editing the underlying view.
MIT License
517 stars 128 forks source link

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

Open mathieu-mbru opened 2 years ago

mathieu-mbru commented 2 years ago

Replace source = doc.to_s by source = doc.to_s.gsub('&lt;', '<').gsub('&gt;', '>').gsub('&amp;', '&') for transforming the encodings

nanego commented 2 years ago

A more generic solution may be this one. Can you please give it a try?

-        source = doc.to_s
+        source = CGI.unescapeHTML doc.to_s
mathieu-mbru commented 2 years ago

Well, thank you for this solution.