neo4j / neo4j-browser

Neo4j Browser is the general purpose user interface for working with Neo4j. Query, visualize, administrate and monitor the database.
https://neo4j.com
GNU General Public License v3.0
693 stars 347 forks source link

Neo4j Browser 'Export JSON' function does not escape backslash #1826

Open markslater opened 2 years ago

markslater commented 2 years ago

When exporting data as JSON from the Neo4j Browser UI, backslashes in the data are not escaped, resulting in invalid JSON.

Steps to reproduce

Create a node with a property that contains a backslash:

CREATE ({name:"AC\\DC"})

Retrieve the property:

MATCH (n) RETURN n.name AS name

Note that in the UI, the name is shown correctly: "AC\DC"

Click on 'Export JSON'

The exported JSON is invalid because the backslash isn't escaped:

[
  {
    "name": "AC\DC"
  }
]

Expected behavior

The exported JSON should escape the backslash:

[
  {
    "name": "AC\\DC"
  }
]