verbb / vizy

A flexible visual editor for Craft CMS
Other
43 stars 8 forks source link

Backslash in text breaks Vizy JSON #249

Closed tomkiss closed 10 months ago

tomkiss commented 10 months ago

Describe the bug

I've just discovered a bug in the Vizy text editor where if you insert a backslash, it breaks the editor.

If I'm honest, I'm pretty chuffed at discovering this bug, it's a good one! 😄

Steps to reproduce

  1. Load a vizy article in the editor.
  2. Add some backslashes to text, for example: C:\Program Files\Adobe.
  3. Save the article, observe when the page reloads, the vizy editor may be broken with a JSON error in the console.

Additionally, if you replace the backslashes with html entities, e.g: \ then these get replaced with backslashes, and the problem still occurs.

Craft CMS version

4.4.16.1

Plugin version

2.1.8

Multi-site?

No

Additional context

No response

engram-design commented 10 months ago

Ah, good call, it's due to how we encode HTML. Fixed for the next release. To get this early, run composer require verbb/vizy:"dev-craft-4 as 2.1.8"

engram-design commented 10 months ago

Fixed in 2.1.9