ArcadeData / arcadedb

ArcadeDB Multi-Model Database, one DBMS that supports SQL, Cypher, Gremlin, HTTP/JSON, MongoDB and Redis. ArcadeDB is a conceptual fork of OrientDB, the first Multi-Model DBMS. ArcadeDB supports Vector Embeddings.
https://arcadedb.com
Apache License 2.0
469 stars 57 forks source link

Unable to add Data with Special Characters via The Studio #1602

Open kkailaasa opened 1 month ago

kkailaasa commented 1 month ago

ArcadeDB Version:

<ArcadeDB Server v24.5.1-SNAPSHOT>

OS and JDK Version:

<ArcadeDB_0> Running on Linux 5.4.0-163-generic - OpenJDK 64-Bit Server VM 11.0.23 (Temurin-11.0.23+9)

Expected behavior

<To preserve the data as is when entered Using the Studio: adding data as string which contains special characters, and using backslash to escape it>

Actual behavior

<Special Characters are removed and replaced with a space, escaping with backslash and percent encoding does not work, for example "LdhgfdY&hgff2&a" becomes "LdhgfdY hgff2 a">

Steps to reproduce

<In Studio Tab Query, enter the following: INSERT INTO Field SET value = 'LdhgfdY&hgff2&a',>

gramian commented 1 month ago

It seems in studio, the table with id result, the & symbol is not escaped to &amp; and thus not rendered correctly.

gramian commented 1 month ago

Further looking into this: The server returns the ampersand symbol as \u0026 and this unicode entity for the ampersand symbol is rendered as whitespace.

A simple .replaceAll("\u0026","&")(or variants thereof) in https://github.com/ArcadeData/arcadedb/blob/main/studio/src/main/resources/static/js/studio-table.js#L87 does not seem to work. Note that it cannot be replaced in the escapeHtml function as this is applied to server inputs and outputs.