arcadedb icon indicating copy to clipboard operation
arcadedb copied to clipboard

Unable to add Data with Special Characters via The Studio

Open kkailaasa opened this issue 1 year ago • 2 comments

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',>

kkailaasa avatar May 18 '24 19:05 kkailaasa

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

gramian avatar May 18 '24 19:05 gramian

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.

gramian avatar May 21 '24 21:05 gramian